首页 > 计算机等级考试
题目内容 (请给出正确答案)
[主观题]

有以下程序#inculde <stdio.h>int F(int t[],int n);main(){int a[4]=(1,2,3,4),s; s =F(a

有以下程序

#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

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“有以下程序#inculde <stdio.h>int F(i…”相关的问题
第1题
有以下程序#inculde<stdio.h>Main(){int a=1,B=2; For(;a<8;a++){B+ =ap; a= =2} print

有以下程序

#inculde<stdio.h>

Main()

{ int a=1,B=2;

For(;a<8;a++) {B+ =ap; a= =2}

printF(“%d,%d\n,a,B”);

}

程序运行后的输出结果是

A.9,18

B.8,11

C.7,11

D.10,14

点击查看答案
第2题
有以下程序#inculde <stdio.h>#deFine N8void Fun(int * x,int i)main(){int a[N]={1,2,3,

有以下程序

#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

点击查看答案
第3题
有以下程序#inculde <stdio.h>int Fun(){ ststic int x=1;x*=2;return x;}main (){ int i,s=1;For(i=1;I<=2,I + +) s =Fun();printF(“%d\n”,s);}程序运行后的输出结果是

A.0

B.1

C.4

D.8

点击查看答案
第4题
有以下程序:#include <stdio, h>void sum(int a[ ] ){a[0]=a[-1] +a[1];}main (){int a[10] = {

有以下程序:#include <stdio, h>void sum(int a[ ] ){ a[0]=a[-1] +a[1];}main (){ int a[10] = {1,2,3,4,5,6,7,8,9,10}; sum(&a[2]); prinff("% d \n",a[2]); }程序运行后的输出结果是()。

A.6

B.7

C.5

D.8

点击查看答案
第5题
有以下程序#inculde <stdio.h>main(){ FILE*Fp;char str[10];Fp=Fopen(“myFile.dat”,”W”);Fputs(“aBc”,Fp);Fclose(Fp);Fp=Fopen(“myFile.dat”,”a+”);FprintFF(Fp,”%d”,28);reWind(Fp);FscanF(Fp,”%s”,str);puts(str);Fclose(Fp);}程序运行后的输出结果是

A.aBc

B.28c

C.aBc28

D.因类型不一致而出错

点击查看答案
第6题
有以下程序:#include <stdio, h>main(){char a1 ='M',a2 ='m'; printf("%c\n",(a1,a2));} 以下

有以下程序:#include <stdio, h>main(){ char a1 ='M',a2 ='m'; printf("%c\n",(a1,a2)); } 以下叙述中正确的是()。

A.程序输出大写字母M

B.程序输出小写字母m

C.格式说明符不足,编译出错

D.程序运行时产生出错信息

点击查看答案
第7题
有以下程序:#include <stdio, h>main(){int m =0256,n =256;printf("% o % o \n" ,m,n); 程序

有以下程序: #include <stdio, h> main() { int m =0256,n =256; printf("% o % o \n" ,m,n); 程序运行后的输出结果是() 。

A.0256 0400

B.0256 256

C.256 400

D.400 400

点击查看答案
第8题
有以下程序: #include <stdio, h>int a =2;int f(int n){ static int a: 3;intt=0;if(n%2){ stat

有以下程序: #include <stdio, h>int a =2;int f(int n){ static int a: 3; int t=0; if(n%2){ static int a=4;t+ =a++;} else { static int a=5;t+ :a++;} return t + a + +;main (){ int s=a,i; for(i=0;i<3;i++)s + =f(i); prinff("% d \n" ,s); }程序运行后的输出结果是()。

A.26

B.28

C.29

D.24

点击查看答案
第9题
有以下程序: #include <stdio, h>void swap1 (int c0[],int e1[] ){intt;t = c0[0]; c0[0]: c1 [

有以下程序: #include <stdio, h>void swap1 (int c0[],int e1[] ){ int t; t = c0[0]; c0[0]: c1 [0] ; c1 [0] = t;}void swap2(int * c0,int * c1){ int t; t= *c0; *c0= *c1; * c1 =t;}main(){ inta[2]={3.5}.b[2]={3,5}; swapl(a,a+1) ;swap2(&b[0],&b[1]); printf("% d %a %d %d \n" ,a[0] ,a[1] ,b[0] ,b[1] ); }程序运行后的车出结果是()。

A.3 5 5 3

B.5 3 3 5

C.3 5 3 5

D.5 3 5 3

点击查看答案
第10题
以下程序用以删除字符串中所有的空格,请填空。inculde <stdio.h>main(){char s[100]=(“our

以下程序用以删除字符串中所有的空格,请填空。

inculde <stdio.h>

main()

{ char s[100]=(“our teacher teach c language!”);int I,j;

For(i=j=0;s[i]!=’’)

iF(s[i];s[i]!=’\0’) {s[j]=s[i];j ++}

s[j]=【 】

printF(“index=%d\n”,s-a);

}

点击查看答案
退出 登录/注册
发送账号至手机
密码将被重置
获取验证码
发送
温馨提示
该问题答案仅针对搜题卡用户开放,请点击购买搜题卡。
马上购买搜题卡
我已购买搜题卡, 登录账号 继续查看答案
重置密码
确认修改