Автор: Cena (16.11.2011 в 22:17)
#include <iostream>
#include <math.h>
#include <cmath>
using namespace std;
int main()
{
double x,xn,xk,dx,a,z,max,min,k;
// Ввод параметров
cout << "xn = ";
cin >> xn;
cout << "xk = ";
cin >> xk;
cout << "dx = ";
cin >> dx;
cout << "a = ";
cin >> a;
for(x = xn; x <= xk; x += dx)
{if(k%4==2)
z = pow(tan(a - x)/(4.35 + sin(a + x)), double(1/3));
cout << "x = " << x << "\t z = " << z << endl;
}max=fabs(z);
min=fabs(z);
if (fabs(z)>max) max=fabs(z);
if (fabs(z)<max) min=fabs(z);
cout<<"max="<<max<<"\t min="<<min<<"\n";
cout<<"R="<<max-min<<"\n";
system("PAUSE");
return 0;
}
а как-то так можно сделать? но у меня выдает ошибку(20 C:\Dev-Cpp\Безымянный14568.cpp invalid operands of types `double' and `int' to binary `operator%' )