#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int x;
double A;
cout<<"Input data:\ nX = ";
cin>>x;
if (x<0)
A=pow(x,2);
else
if (x==0)
A=sin(x);
A=cos(x);
cout << "Answer : \nA = " << A << endl;
system("pause");
return 0;
}
Объяснение:
cout<<"Input data:\nX = ";
if (x<0){
else if (x==0){
else {
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int x;
double A;
cout<<"Input data:\ nX = ";
cin>>x;
if (x<0)
A=pow(x,2);
else
if (x==0)
A=sin(x);
else
A=cos(x);
cout << "Answer : \nA = " << A << endl;
system("pause");
return 0;
}
Объяснение:
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int x;
double A;
cout<<"Input data:\nX = ";
cin>>x;
if (x<0){
A=pow(x,2);
}
else if (x==0){
A=sin(x);
}
else {
A=cos(x);
}
cout << "Answer : \nA = " << A << endl;
system("pause");
return 0;
}