#include<stdio.h>
double main()
{
double x,y;
scanf("%f",&x);
printf("输入x的值为");
if(x<1)
{y=x*x;}
else
{
x>=10?
y=3x-11:
y=2x-1;
}
printf("y=%f",y);
return 0;
}
错误提示
G:\c语言试水基地\111.cpp(15) : error C2059: syntax error : 'bad suffix on number'
G:\c语言试水基地\111.cpp(15) : error C2146: syntax error : missing ',' before identifier 'x'
G:\c语言试水基地\111.cpp(16) : error C2059: syntax error : 'bad suffix on number'
G:\c语言试水基地\111.cpp(16) : error C2146: syntax error : missing ';' before identifier 'x'
G:\c语言试水基地\111.cpp(16) : warning C4552: '-' : operator has no effect; expected operator with side-effect
执行 cl.exe 时出错.
慕瓜9220888
相关分类