第1题
有以下程序
#inculde <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
第2题
有以下程序: #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
第3题
(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\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
第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\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
第5题
有以下程序: #include<stdio.h> int f(int t[],int n); main() {int a[4]={1,2,3,4},s; s=f(a,2);printf("%d\n",s); } int f(int t[],int n) {if((n>0)&&(n<5))return t[n+1]+f(t,n-1); else return 0; } 程序运行后的输出结果是()。
A.4
B.7
C.10
D.61
第6题
有以下程序
#inculde <stdio.h>
#inculde <string.h>
strtict A
{ int a;char B[10];douBle c;};
void F (struct A t);
main()
{ struct A a ={1001,”zhangDa”,1098.0};
F(a);printF(“%d,%s,%6.1F\n”,a.,a.B,a.c);
void F(struct A t)
{ t.a=1002;strcpy(t.B,”ChangRong”);t.c=1202.0;}
程序运行后的输出结果是
A.1001,zhangDa,1098.0
B.1002,ChangRong,1202.0
C.1001,ChangRong,10980
D.1002,zhangDa,1202.0
第7题
有以下程序
#inculde <stdio.h>
#deFine N8
void Fun(int * x,int i)
main()
{ int a[N]={1,2,3,4,5,6,7,8},i;
Fun(a,2);
For(i=0;i<N/2;i++)
{ printF(“%d”,a[i]);}
PrintF(“\n”);
}
程序运行后的输山结果是
A.1313
B.2234
C.3234
D.1234
第8题
有以下程序: int a=4; int f(int n) { int t=0; static int a=5; if(n%2) {int a=6; t+=a++;} else {int a=7; t+=a++;} return t+a++; } main() { int s=a,i=0; for(;i<2; i++) s+=f(i); printf("%d\n",s); } 程序运行后的输出结果是()。
A.24
B.28
C.32
D.36
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!