#include <stdio.h>
int main()
{
// 定义变量sum, num
int sum, num;
sum = 0;
for(num = 0; num<=10 ; num++ ) //for循环条件与num的变化值
{
sum=sum+num; //计算每次数字之间的和sum
????????????????; //显示每次循环的neirong
}
printf("10以内数的和为:%d", sum);
return 0;
}
应该是
printf("%d=%d+%d",sum,sum-num,sum);
刚才打错了
printf("%d=%d=%d",sum,sum-num,sum);