填空题

以下程序运行后的输出结果是 【18】 。
fun(int x)
if(x/2>0)fun(x/2);
printf("%d ",x);
main()
fun(6);

【参考答案】

1 3 6
<上一题 目录 下一题>
热门 试题

单项选择题
(48)~(50)以下程序的功能是:建立一个带有头结点的单向链表,并将存储在数组中的字符依次转存到链表的各个结点中,请从与下划线处号码对应的一组选项中选择出正确的选项。 #include <stdlib.h> struct node char data; struct node *next;; (48) CreatList(char *s) struct node *h,*p,*q; h=(struct node *)malloc(sizeof(Struct node)); p=q=h; while(*s!=‘ 0’) p=(struct node *)malloc(sizeof(struct node)); p->data=(49); q->next=p; q=(50); s++; p->next=0; return h; main() char str[]= link list ; struct node *head; head=CreatList(str);
A.char*
B.stmct node
C.strumnode*
D.char
填空题
以下程序的功能是将字符串s中的数字字符放入d数组中,最后输出d中的字符串。例如,输入字符串:abcl23edf456gh,执行程序后输出:123456。请填空。 #include <stdioo.h> #include <ctype.h> main() char s[80],d[80]; int i,j; gets(s); for(i=j=0;s[i]!=’ 0’;i++) if( 【20】 )d[j]=s[i];j++; d[j]=’ 0’; puts(d);
相关试题
  • 有以下程序: main() char k; int ...