这个执行代码块该怎么写
#include<stdio.h>
int main()
{
int i = 1,sum = 0;
while(i <= 100)
{
sum = sum + 1;
//这行怎么写
}
printf("100以内所有整数之和为:%d\n",sum);
return 0;
}
#include<stdio.h>
int main()
{
int i = 1,sum = 0;
while(i <= 100)
{
sum = sum + i;
i++;
}
printf("100以内所有整数之和为:%d\n",sum);
return 0;
}