当前位置: 答题翼 > 问答 > 计算机类考试 > 正文
目录: 标题| 题干| 答案| 搜索| 相关
问题

(19)有以下程序#include <stdio.h>main(){ int s;scanf("%d",&s);while(s>0){ swit


(19)有以下程序

#include <stdio.h>

main()

{ int s;

scanf("%d",&s);

while(s>0)

{ switch(s)

{ case1:printf("%d",s+5);

case2:printf("%d",s+4); break;

case3:printf("%d",s+3);

default:printf("%d",s+1);break;

}

scanf("%d",&s);

}

}

运行时,若输入1 2 3 4 5 0<回车>,则输出结果是

A)6566456

B)66656

C)66666

D)6666656

请帮忙给出正确答案和分析,谢谢!

参考答案
您可能感兴趣的试题
  • 请阅读下述代码,写出程序执行的结果#include &lt;iostream&gt; using namespace std; class C

  • 请阅读下述代码,写出程序执行的结果#include &lt;iostream&gt; using namespace std; class C

  • (37 )有以下程序#include &lt;stdio.h&gt;#include &lt;string.h&gt;struct A{ int a; char b[1

  • (12 ) 有以下程序#include &lt;stdio.h&gt;#include &lt;string.h&gt;void fun (char *str ){

  • (12 ) 有以下程序#include &lt;stdio.h&gt;#include &lt;string.h&gt;void fun (char *str ){

  • 有以下程序#include &lt;stdio.h&gt;#include &lt;string.h&gt;main(){ printf("%d ",strlen (