单项选择题

有以下程序
#include<stdio.h>
void fun(int n,int*p)
int f1,f2;
if(n==1||n==2)*p=1;
else
fun(n=1,&f1);fun(n-2,&f2);
*p=f1+f2;
main()
int s;
fun(3,&,s);printf("%d",s);
程序的运行结果是( )。

A.2
B.3
C.4
D.E
<上一题 目录 下一题>
热门 试题

单项选择题
有以下程序 #include<stdio.h> #include<string.h> void fun(char s[][10],int n) char t;int i,j; for(i=0;i<n-1;i++) for(j=i+1,j<n;j++) *比较字符串的首字符大小,并交换字符串的首字符* if(s[0])>s[j][0]t=s[i][0]; s[i][0]=s[j][0];s[j][0]=t; main() char ss[5][10]= bcc , bbcc , xy , aaaaec , aabcc fun(ss,5);printf( %s,%s ,ss[0],ss[4]); 程序运行结果是( )。
A.xy,aaaacc
B.aaaacc,xy
C.XCC,aabcc
D.acc,xabcc
单项选择题
当用户要求输入的字符串中含有空格时,应使用的输入函数是( )。
A.scanf()
B.getchar()
C.gets()
D.getc()
相关试题
  • 有以下程序 #include<stdio.h> Struc...
  • 有以下程序 #include<stdio.h> int ...
  • 有以下程序 #include<stdio.h> void...
  • 有以下程序 #include<stdio.h> int ...
  • 有以下程序 #include<stdio.h> main...