qfedu-c-level/test/t1_4.c

15 lines
310 B
C
Raw Normal View History

#include <stdio.h>
int main()
{
int i;
int sum = 1;
for (i = 1; i <= 10; i++)
{
sum += i; // 加完之后才判断是否为5因此sum会加上5
if (i == 5)
continue;
// printf("i = %d, sum=%d\n", i, sum);
}
printf("sum=%d\n", sum);
return 0;
}