Online C++ compiler to run C++ program online
Download 0.84 Mb.
|
Online C1
// Online C++ compiler to run C++ program online #include #include using namespace std; int main() { float a,b,h,x[100] ,S=0; int n=10; cout<<"Pastki chegarani kiriting: "; cin>>a; cout<<"Yuqori chegarani kiriting: "; cin>>b; h=(b-a)/n; float F; for(int i=0;i<10;i++){ if(i==0 && i==9){ x[0]=a; x[9]=b; S+= (pow((0.3*x[i]+2.3),1.0/1.8))/(2*x[i]+sqrt(x[i]*x[i]+1.6)); } else{ x[i]=a+i*h; S+= (pow((0.3*x[i]+2.3),1.0/1.8))/(2*x[i]+sqrt(x[i]*x[i]+1.6)); } } F=h*S; cout< } Pastki chegarani kiriting: 1.8 Yuqori chegarani kiriting: 0.3 -0.701845 #include #include using namespace std; float f(float t) { return
; } int main (){ float S,a,b,h,x; int n,i; cin>>a>>b>>n; h=(b-a)/(2*n); S=f(a)+f(b); for (i=1;i<2*n;i++){ x=a+i*h;
else S=S+1*f(x); } S=S*h/0.5; cout< } 1.2 2.4 3 5.80305 #include using namespace std; int main() { //srand(time(0)); int n,m; cout <<"satr va ustun olchami: "; cin >> n >> m; float a[n][m], b[n][m], q[n][m]; int i,j,s; cout <<"\n a matritsa : \n"; for(i=0; i }} cout <<"******** \n"; for(i=0; i }cout <<"\n";} cout <<"\n b matritsa : \n"; for(i=0; i }} cout <<"******** \n"; for(i=0; i }cout <<"\n";} cout <<"\n\n"; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { q[i][j] = 0; q[i][j] += (a[i][j]-b[i][j])*a[i][j] + 3 * b[i][j]; } } cout << "q matritsa : "< for (int j = 0; j < m; j++) { cout << q[i][j] <<"\t"; }cout<<"\n"; } return 0; } /tmp/vwAQVpGpFt.o satr va ustun olchami: 3 3 a matritsa : 3 2 -5 4 2 0 1 1 2 ******** 3 2 -5 4 2 0 1 1 2 b matritsa : -1 2 4 0 3 2 -1 -3 4 5 ******** -1 2 0 3 2 -1 -3 4 5 q matritsa : 9 6 25 13 6 -3 -5 9 9 Download 0.84 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling