大家帮我看看这个c语言代码哪出错了到底
#include<stdio.h>main(){inti,sum;sum=0;for(i=1;i<=100;i++){sum=sum+i;}printf("\n1+2+3...
#include <stdio.h>
main()
{
int i, sum;
sum=0;
for (i=1; i<=100; i++) {
sum=sum+i;
}
printf("\n1+2+3+...+99+100=%d, sum);
}
错误提示是这样的
F:\c++ 6.0\MSDev98\MyProjects\e3rerrr\fgfgf.c(10) : error C2001: newline in constant
F:\c++ 6.0\MSDev98\MyProjects\e3rerrr\fgfgf.c(11) : error C2143: syntax error : missing ')' before '}' 展开
main()
{
int i, sum;
sum=0;
for (i=1; i<=100; i++) {
sum=sum+i;
}
printf("\n1+2+3+...+99+100=%d, sum);
}
错误提示是这样的
F:\c++ 6.0\MSDev98\MyProjects\e3rerrr\fgfgf.c(10) : error C2001: newline in constant
F:\c++ 6.0\MSDev98\MyProjects\e3rerrr\fgfgf.c(11) : error C2143: syntax error : missing ')' before '}' 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询