Пишет ошибку в 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; }

uhsdjhsilhiilch uhsdjhsilhiilch    2   29.08.2019 13:30    2

Ответы
Спасибо666 Спасибо666  06.10.2020 02:57
Вот так правильно и тебе там нужно объявить 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;}
ПОКАЗАТЬ ОТВЕТЫ
Другие вопросы по теме Информатика