单项选择题

有以下程序:
main()
int k=5, n=0;
do
switch(k)
case 1:case 3:n+:1;k--;break;
default:n:0;k--;
case 2:case 4:n+=2;k--;break;

printf("%d",n):
while(k>0 && n<5);

程序运行后的输出结果是()。

A.235
B.0235
C.02356
D.2356
<上一题 目录 下一题>
热门 试题

单项选择题
有以下程序: #include<stdio.h> main() char c1,c2,c3,c4,c5,c6; scanf( %c%c%c%c ,&c1,&c2,&c3,&c4); c5=getchar();c6=getchar(); putchar(c1); putchar(c2); printf( %c%c n ,c5,c6); 程序运行后,若从键盘输入(从第1列开始) 123<回车> 45678<回车> 则输出结果是()。
A.1267
B.1256
C.1278
D.1245
单项选择题
有以下结构体说明和变量定义,如下图所示,指针p、 q、r分别指向一个链表中的三个连续结点。 struct node int data; struct node *next; )*p,*q,*r; data next data next data next 现要将q和r所指结点的先后位置交换,同时要保持链表的连续,以下错误的程序段是()。
A.r→next=q;q→next=r→next;p →next;r;
B.q→next=r→next;p→next=r;r→next=q;
C.p→next=r;q→next=r→next;r→next=q;
D.q→next=r→next;r→next=q;p→next=r;
相关试题
  • 以下程序的输出结果是( )。 main() ...
  • 设有定义:int a; float b;,执行scan...
  • 以下程序的输出结果是( )。 long fun...
  • 有以下程序: fun(int x,int y)(ret...
  • 有以下程序: struct s int x,y;) ...