单项选择题

有以下程序
#include <stdio.h>
int f(int x)
int y;
if(x==0||x==1) return(3);
y=x*x-f(x-2);
return y;
main()
int z;
z=f(3); printf("%d\n",z);
程序的运行结果是

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

单项选择题
有以下程序 #include <stdio.h> main() int x=1,y=0,a=0,b=0; switch(x) case 1: switch(y) case 0:a++; break; case 1:b++; break; case 2:a++;b++; break; case 3:a++;b++; printf( a=%d,b=%d n ,a,b); 程序的运行结果是
A.a=1,b=0
B.a=2,b=2
C.a=1,b=1
D.a=2,b=1
单项选择题
阅读下列程序,当运行函数时,输入asd af aa z67,则输出为 #include <stdio.h> #include <ctype.h> #inelude <string.h> int fun(char *str) int i,j=0; for(i=0;str[i]!=’ 0’;i++) if(str[i]!=’’)str[j++]=str[i]; str[j]=’ 0’; main() char str[81]; int n; printf( Input a string: ); gets(str); puts(str); fun(str); printf( %s n ,str);
A.asdafaaz67
B.asd af aa z67
C.asd
D.z67
相关试题
  • fseek函数的正确调用形式是 【14】 。
  • 以下程序的作用是:从名为filea.dat的文本...
  • 以下说明语句中, 【13】 是结构体类型...
  • 函数my_cmp()的功能是比较字符串s和t的...
  • 以下程序的输出结果是 【12】 。 floa...