单项选择题

有以下程序:
#include<stdio.h>
int f(int t[],int n);
main()
int a[4]=[1,2,3,4],s;
s=f(a,4);printf("%d\n",s);
int f(int t[],int n)
if(n>0)return t[n-1]+f(t,n-1);
else return 0;
程序运行后的输出结果是( )。

A.4
B.10
C.14
D.6
<上一题 目录 下一题>
热门 试题

单项选择题
有以下程序: #include<stdio.h> main() int i,j,m=1; for(i=1;i<3;i++) for(j=3;j>0;j--) if(i*j>3)break; m*=i+j; printf( m=%d n ,m); 程序运行后的输出结果是( )。
A.m=6
B.m=2
C.m=4
D.m=3
单项选择题
有以下程序: #include<stdio.h> main() FILE*fp;char str[10]; fp=fopen( myfile,dat , ); fputs( abc ,ip);fclose(fp); fp=fopen( myfile.dat , a* ); fprintf(fp, %d ,28); rewind(fp); fscanf(fp, %s ,str);puts(str); fclose(fp); 程序运行后的输出结果是( )。
A.abc
B.28c
C.abc28
D.内类型不一致而出错
相关试题
  • 以下程序的功能是:借助指针变量找出数组元...
  • 以下程序用以删除字符串中所有的空格,请填...
  • 以下程序的功能是:将值为三位正整数的变量...
  • 有以下程序: #include<stdio.h> #i...
  • 有以下程序: #include<stdio.h> mai...