Предмет: Информатика,
автор: nikiton2000
Пишет ошибку в 15 строчке: else without a previous if
#include
#include
using namespace std;
int main()
{
int x;
float A;
cout<<"Введите х="<
cin>>x;
if (x >= M_PI);
{
A=0;
cout<<"y=0"<
}
else
if(M_PI>x && x>=0)
{
A=sin(x);
cout<<"y=sin(x)"<
}
else
if (0>x && x>=-2)
{
A=0;
cout<<"y="<
}
else
if (x<=-2)
{
A = pow((x+2),2);
cout <<"y="<
}
return 0;
}
Ответы
Автор ответа:
0
вот так правильно и тебе там нужно объявить M_PI
#include <iostream>#include <cmath>using namespace std;int main(){ int x; float A; cout<<"Введите х="; cin>>x; if (x >= M_PI){ A=0; cout<<"y=0"; } else if(M_PI>x && x>=0) { A=sin(x); cout<<"y=sin(x)"; } else if (0>x && x>=-2){ A=0; cout<<"y="; } else if (x<=-2) { A = pow((x+2),2); cout <<"y="; }
return 0;}
#include <iostream>#include <cmath>using namespace std;int main(){ int x; float A; cout<<"Введите х="; cin>>x; if (x >= M_PI){ A=0; cout<<"y=0"; } else if(M_PI>x && x>=0) { A=sin(x); cout<<"y=sin(x)"; } else if (0>x && x>=-2){ A=0; cout<<"y="; } else if (x<=-2) { A = pow((x+2),2); cout <<"y="; }
return 0;}
Zhumabekanele:
я все проверила!!! Это правильно
Похожие вопросы
Предмет: Русский язык,
автор: baielmelisov15
Предмет: Право,
автор: kandybormariaaroslav
Предмет: Математика,
автор: l68578127
Предмет: Математика,
автор: Аноним
Предмет: Биология,
автор: galba2013