lucifanya
Newbie | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору ПОМОГИТЕ исправить ошибки в программах: 1. нужно чтобы вместе со всеми x, выводились и все y и z #include <iostream.h> #include <conio.h> #include <iomanip.h> #include <math.h> void main() { int m=0, n=0; float x,y,z,dx,xn, xk, S=0; clrscr(); cout<<setw(25)<<" "<<"Введите xn, xk, dx "<<endl; cin>>xn>>xk>>dx; cout<<setw(25)<<" "<<"Resultati vichisleniy"<<endl; for(x=xn; x<xk; x += dx) cout<<setw(10)<<" "<<"x="<<x<<endl; { if (x> 0.5) z= log(x+1) - 2*x*x*x; else if(x+1<0) { cout<<"\tz=net resheniy"<<"\ty=net reseniy"<<endl; goto M1; } else z = sqrt(x+1) + pow( sin(x), 2); S+= z; y = pow(z, (-x)) + tan(x); if(y>0) m++; else if (y<0) n++; cout<<setw(10)<<" "<<"y="<<y<<setw(10)<<" "<<"z="<<z<<endl; cout<<setw(10)<<" "<<"S="<<S<<setw(10)<<" "<<"m="<<m<<setw(10)<<" "<<"n="<<n; M1: getch(); } } Добавлено: 2. не пойму где ошибка((( #include <iostream.h> #include <conio.h> #include <iomanip.h> #include <math.h> void main() { float x, y, dx, F, S=0,xn , a, b, P=1; clrscr(); cout<<setw(25)<<" "<<"Введите xn, dx, a, b"<<endl; cin>>xn>>dx>>a>>b; cout<<setw(25)<<" "<<"Resultati vichisleniy"<<endl; while (x*x*x +x*x +x>0) { cout<<"x="<<x; if(a*a*x<b*b*b) y = exp(sin (x)); else { if(a*a*x == b*b*b) if(sin(x)!=0) { cout<<"\ty=net resheniy"<<"\tF=net resheniy"<<endl; goto M1; } else y = (b*b-a)/sin(x); else y = cos(4*x)*cos(4*x); } cout<<"y="<<y<<endl; F = 5.37*y + log(x*x*x + x*x + x); cout<<"\tF="<<F<<endl; if(F>0) P =P*y else S= S + F; M1: x = x + dx; } cout<<"\tS="<<S<<"\tP="<<P<<endl; getch(); } 3. два ошибки ((( # include <iostream.h> # include <math.h> # include <iomanip.h> # include <conio.h> void main() { float an, ak, ah, bn, bk, bh, c, x, y, a , b; clrscr(); cout <<"BBedute an, ak, ah, bn, bk, bh, c"<<endl; cin>>an>>ak>>bn>>bk>>c>>ah>>bh; for (a=an;a<=ak;a+=ah); cout<<"a="<<a<<endl; for(b=bn;b<=bk;b+=bh); { cout<<"b="<<b<<endl; if (c==0) { cout<<"\tx = net resheniy"<<"\ty = net resheniy"<<endl; goto M1; } else { x = -fabs(a+5)/(c*c) + b*c*c; cout<<"\tx="<<x; if(x==0) { cout<<"\t = net resheniy"<<y<<endl; goto M1; } else { y = b*b*c+fabs(a/x)+1; cout<<"y="<<y<<endl; M1: } }} getch(); } 4. тут вобше завал # include <iostream.h> # include <math.h> # include <iomanip.h> # include <conio.h> void main() { const short m=5, n = 4; short n, i, j; float S=0, C[m][n], M[m]; clrscr(); cout<<"Matrica C"<<endl; for(i=0; i < m, i++) for(j=0; j < n, j++) { cout<<"C["<<i<<"]["<<j<<"]="; cin>>C[i][j]; } for(i=0, i < m, i++) { cout<<endl; for(j=0, j < n, j++) cout<<"\t"<<C[i][j] for(i=o, i < M, i++) { S=0; for(j=0; j < n, j++) S= S + fabs(C[i][j]); M[i] = S; cout<<"Massiv M"<<endl; for(i=0; i < m, i++) cout<<"\t"<<M[i]; getch(); } 5. и тут завал((((( # include <iostream.h> # include <math.h> # include <iomanip.h> # include <conio.h> void main() { const short M=50; short k=0, n; float S=0, X[M], y[M]; clrscr(); cout<<"n="; cin>>n; cout<<"Masiv X"<<endl; for (i=1, i<n, i++) { cout<<"X["<<i<<"]="; cin>>X[i]; } k=0; for (i=1, i<n, i++) if(X[i]>0) { k++; y[k]=x[i]; } cout<<"k="<<k<<endl; cout<<"masiv y"<<endl; for (i=1, i<k, i++) cout<<"\t"<<y[i]; S=0; for (i=1, i<k, i++) S= S + y[i]; cout<<"\hs="<<s; } Очень нужна помошь... помогите,к то сможет. Буду ОЧЕНЬ благодарен |