qfedu-c-level/test/t1_4.c

15 lines
310 B
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#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;
}