单项选择题

以下程序的输出结果是( )。
#include<stdio.h>
int f()
static int i=0;
int s=1;
s+=i; i++;
return s;
main()
int i, a=0;
for(i=0; i<5; i++) a+=f();
printf("%d\n", a);

A) 20
B) 24
C) 25
D) 15
<上一题 目录 下一题>
热门 试题

单项选择题
有以下程序: #include <stdio.h> int f(int x) inty; 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> void fun(char *str) int a, b; for(a=b=0; str[a]!=' 0'; a++) if(str[a]!='c') str[b++]=str[a]; str[b]=' 0'; void main() char str[]= abcdef ; fun(str); printf( str[]=%s , str);
A) str[]=abdef
B) str[]=abcdef
C) str[]=a
D) str[]=ab
相关试题
  • 若fp是指向某文件的指针,且已读到文件末尾...
  • 在位运算中,操作数每右移一位,其结果相当...
  • 有以下程序: struct s int x, y; ...
  • 有以下程序段: struct st int x; in...
  • 若有以下的说明,对初值中整数2的正确引用...