运行成功,输出错误,答案算出来是11,请问为啥
#include <stdio.h>
int main()
{
int sum, num;
sum = 0;
for(num = 0;num <= 10;num++ );
{
sum = sum + num;
}
printf("10以内数的和为:%d", sum);
return 0;
}
#include <stdio.h>
int main()
{
int sum, num;
sum = 0;
for(num = 0;num <= 10;num++ );
{
sum = sum + num;
}
printf("10以内数的和为:%d", sum);
return 0;
}
2019-08-13
举报