首页 > 试题广场 >

下列程序将打印出什么? #include in

[问答题]
下列程序将打印出什么?
#include <stdio.h>
int main (void)
{
int i = 0;
while (i < 3) {
switch (i++) {
case 0: printf ("fat");
case 1: printf ("hat");
case 2: printf ("cat");
default: printf ("Oh no! ");
}
putchar ('\n');
}
return 0;
}

推荐
程序打印以下内容:
fat hat cat Oh no!
hat cat Oh no!
cat Oh no!
发表于 2018-03-25 09:19:39 回复(0)