80-for嵌套循环111
1 # include <stdio.h> 2 3 int main (void) 4 5 { 6 int i,j; 7 8 for (i = 0;i < 3; ++i) 9 for (j = 2; j < 5; ++j)//在这个最后面加上分号,会导致运行结果只有一个哈哈 10 printf ("哈哈!\n"); 11 printf ("嘻嘻!\n"); 12 return 0; 13 }
在vc中的运行结果
---------------------------------------
哈哈!
哈哈!
哈哈!
哈哈!
哈哈!
哈哈!
哈哈!
哈哈!
哈哈!
嘻嘻!
Press any key to continue
----------------------------------------
浙公网安备 33010602011771号