填空题

以下程序运行后的输出结果是 。
#include <stdio.h>
fun(int x)
if(x/2>0) fun(x/2);
printf("%d",x);

main()
fun(6);

【参考答案】

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

填空题
以下fun函数的功能是在N行M列的整型二维数组中,选出一个最大值作为函数值返回,请填空。(设M,N已定义) int fun(int a[N][M]) int i,j,row=0,co1=0; for(i=0;i<N;i++) for(i=0;j<M;j++) if(a[i][j]>a[row][co1])row=i;co1=j; return ;
填空题
以下程序中函数fun的功能是:构成一个如图所示的带头节点的单向链表,在节点的数据域中放入了具有两个字符的字符串。函数disp的功能是显示输出该单链表中所有节点中的字符串。请填空完成函数disp。 #include<stdio.h> typedef struct node *链表节点结构* char sub[3]; struct node*next; Node; Node fun(char s) *建立链表* … void disp(Node*h) Node*p; p=h->next; while______ printf( %s n ,p->sub); p=p->next; main() Node*hd; hd=fun(); disp(hd); printf( n );
相关试题
  • 有以下程序void sum(int a[]) a[0...
  • 以下程序运行后的输出结果是() #includ...
  • 有下列程序: #include<stdio.h> mai...
  • 以下合法的字符型常量是()
  • 若有说明:int *p,m=5,n;,则以下程...