单项选择题

以下程序的输出结果是( )。
#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
相关试题
  • [解析] 填空1:ss中有N个字符串,所以i...
  • i
  • 规定输入的字符串中只包含字母和*号。请编...
  • N
  • 下列给定程序中函数fun的功能是:从整数1...