单选题 C语言
题号 #2269285

有以下程序:
#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;
}
程序运行后的输出结果是(  )。

进入在线模考

参考答案

B

答案解析

本题考查了函数的调用,并且使用了嵌套。

你可能感兴趣的试题

找试题 · 找答案 · 找资料 在线模考