单项选择题

有以下程序:
#include <stdio, h>
main ( )
int k=5,n =0;
while ( k>0)
switch (k)
default: break;
case 1 : n+ =k;
case 2 :
case3 : n+ =k;

k--;
printf( "% d \n" ,n);程序运行后的输出结果是( )。

A.0
B.4
C.6
D.7
<上一题 目录 下一题>
热门 试题

单项选择题
有以下程序: #include <stdio, h>void swap1 (int c0[],int e1[] ) int t; t = c0[0]; c0[0]: c1 [0] ; c1 [0] = t;void swap2(int * c0,int * c1) int t; t= *c0; *c0= *c1; * c1 =t;main( ) inta[2]=3.5.b[2]=3,5; swapl(a,a+1) ;swap2(&b[0],&b[1]); printf( % d %a %d %d n ,a[0] ,a[1] ,b[0] ,b[1] ); 程序运行后的车出结果是( )。
A.3 5 5 3
B.5 3 3 5
C.3 5 3 5
D.5 3 5 3
单项选择题
有以下程序: #include <stdio.h>#include <string.h>void f(char * s,char*t) char k; k=*s; *s=*t; *t=k; s++; t--; if( * s) f(s,t);main( ) char str[10] : abedefg , * p; p = str + strlen(str) 2+1; f(p,p -2); printf( % s n ,str);程序运行后的输出结果是( )。
A.abcdefg
B.gfedcba
C.gbcdefa
D.abedcfg
相关试题
  • 有以下程序: #include <stdio, h>v...
  • 有以下程序:#include <stdio.h>strue...
  • 有以下程序:#include <stdlo.h>main...
  • 有以下程序:#include <stdio, h>#i...
  • 有以下程序:#include <stdio.h>float...