为什么int sun;num之后不能再加个int sum = 0 而是sum = 0 呢?
#include <stdio.h>
int main ()
{
int num,sum;
sum = 0;
for(num = 0 ; num <= 10 ; num++)
{
sum += num;
}
printf("10以内数的和为:%d", sum);
return 0;
}
#include <stdio.h>
int main ()
{
int num,sum;
sum = 0;
for(num = 0 ; num <= 10 ; num++)
{
sum += num;
}
printf("10以内数的和为:%d", sum);
return 0;
}
2019-12-29
举报