NO.234程序出错
本帖最后由 我爱橙 于 2022-2-25 10:29 编辑#include <stdio.h>
int main()
{
printf("%d\n",int((3.0+2.5)/3));
return 0;
}
#include <stdio.h>
int main()
{ double a,b;
int c;
a=2.5;
b=3.0;
c=3;
printf("%d\n",int((a+b)/c));
return 0;
}
两个都报错 stray '\243' in program
stray '\250' in program
expected ';' before string constant
没懂哪有字符串常量前要加; #include <stdio.h>
int main()
{
double a, b;
int c;
a = 2.5;
b = 3.0;
c = 3;
printf("%d\n", (int)((a + b) / c)); // 注意这里
return 0;
} #include <stdio.h>
int main()
{
printf("%d\n",(int)((3.0+2.5)/3));// 你左边的括号用了中文括号,还有int要加括号
return 0;
}
#include <stdio.h>
int main()
{ double a,b;
int c;
a=2.5;
b=3.0;
c=3;
printf("%d\n",(int)((a+b)/c));// 你左边的括号用了中文括号,还有int要加括号
return 0;
}
页:
[1]