当前位置: 答题翼 > 问答 > 计算机类考试 > 正文
目录: 标题| 题干| 答案| 搜索| 相关
问题

(33 )有以下程序#include <studio.h>int f (int t[],int n ) ;main{ int a[4]={1,2,3,4}


(33 )有以下程序

#include <studio.h>

int f (int t[],int n ) ;

main

{ int a[4]={1,2,3,4},s;

s=f (a,4 ) ; printf (" %d " ,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&lt;stdio.h&gt;main(){ char*s=&quot;[2]34&quot;;int k=0,a=0; whil(s[k+

  • (33 )有以下程序#include &lt;studio.h&gt;int f (int t[],int n ) ;main{ int a[4]={1,2,3,4}

  • (19)有以下程序#include &lt;stdio.h&gt;main(){ int s;scanf("%d",&amp;s);while(s&gt;0){ swit

  • (33)有以下程序#include &lt;stdio.h&gt;int fun (int x,int y){ if (x!=y) return ((x+y);2);el

  • (38)有以下程序#include &lt;stdio.h&gt;struct S{ int a,b;}data[2]={10,100,20,200};main(){ s

  • 有以下程序#include &lt;stdio.h&gt;main() { int s=0,n; for(n=o;n&lt;3;n++) { switch(s)