下面程序的输出结果是________。#includeint f(){static int i=0;int s=1;s+=i; i++;return s;}int main() {int i,a=0;for(i=0;i<5;i++) a+=f();printf("%d\n",a);}
查看答案
下面程序的输出结果是________。#includeint x=1;fun(int m){int x=5; x+=m; printf("%d ",x); m++;}int main(){int m=3; fun(m); x+=m++; printf("%d ",x);}
A. 8 5
B. 8 4
C. 9 5
D. 9 4
下面程序的输出结果是________。#includef(int b[],int m,int n){int i,s=0;for(i=m;i<=n;i=i+2) s=s+b[i];return s;}int main(){int x,a[]={1,2,3,4,5,6,7,8,9};x=f(a,3,7);printf("%d",x);return 0;}
A. 8
B. 18
C. 10
D. 20
以下程序的输出结果是_______。#includefun(int p[],int a,int b){int i,s=1;for(i=a;i<=b;i++)s*=p[i];return s;}int main(){int x,a[]={1,2,3,4,5,6,7,8,9};x=fun(a,4,6);printf("%d\n",x);}
A. 150
B. 210
C. 60
D. 24
以下程序计算10个数的平均值,请填空完成程序。#includefloat average(float array[10]){int k;float aver, sum=array[0];for(k=1;_________;k++) sum+=__________;aver=sum/10;return(aver);}int main(){float score[10],aver; int k;for(k=0;k<10;k++) scanf("%f", &score[k]);aver=_____________;printf("%8.2f\n",aver);}