0
已解决
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
double y,x;
cin>>x;
if(x<=-2)
printf("%.3f",y=x*3+4.5);
else
{
if(-2<x||-2<=2)
printf("%.3f",y=x^2+1);
}
else
printf("%.3f",y=/3+x/5);
{
if(x>15)
printf("%.3f",y=x/2+6.5);
}
cout<<y;
return 0;
}
0
已采纳
定义是谁暗恋过y,x;
输入x
if (x<=-2)
{
y=x*3+4.5;
}
if (x>-2&&x<=2)
{
y=x*x+1;
}
if (x>2&&x<=15)
{
y=x/3+x/5;
}
if (x>15)
{
y=x/2+6.5;
}
printf ("%.3f\n",y);
张睿杰在2018-01-29 09:57:18追加了内容
不小心搞错了,第一行是定义实数型变量
0
0