Регистрация
17 Авг 2013
Сообщения
77
Репутация
0
Спасибо
0
Монет
0
Почему не выводит положительные значения х и у?
#include
#include
#include
using namespace std;

int main()
{ double a,b,h,x,y,i,eps=0.001;
cout << "Enter [a,b],h" << endl;
cin>>a>>b>>h;
x=a;
i=1;
cout<<fixed <<setprecision(8);
while(x<b+eps){
if(x<0) y=-pow(fabs(x),1./3);
else if(x=0) y=0;
else y=pow(x,1./3);
cout<<"x="<<x<<" "<<"y="<<y<<endl;
x=a+i*h;
i++;
}
return 0;
}
 
Назад
Сверху