首页 > 外语类考试
题目内容 (请给出正确答案)
[单选题]

有以下程序#include<stdio.h>int fun(){static int x=l:X*=2:return X:}main(){int i,s=l:for(i=l;i<=3,i++) s*=fun();printf(“%d\n”,s);}程序运行后的输出结果是

A.0

B.10

C.30

D.64

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“有以下程序#include<stdio.h>int fun(…”相关的问题
第1题
若有如下程序,则程序运行结果为:()#include<stdio. h>main(){ int x=1, a=0;switch (x)case 1:a++;case 2: a++ ;break;case 3: a++ ; break;printf(”a=%d\n" ,a)

A.=0

B.=1

C.=2

D.=3

点击查看答案
第2题
有以下程序:#include<stdio.h>#include<string.h>#includevoid f(char*s,char*t){char k;k=*s; *

有以下程序: #include<stdio.h> #include<string.h> #include void f(char*s,char*t) { char k; k=*s; *s=*t; *t=k; s++;t--; if(*s)f(s,t): } main() {char str[10]="abcdefg",*P; P=str+strlen(str)/2+1: f(p,p-2); printf("%s\n",str); } 程序运行后的输出结果是()。

A.abcdefg

B.gfedcba

C.gbcdefa

D.abedcfg

点击查看答案
第3题
有以下程序 include<stdio.h> intfun(){ staticintx=1; x+=1: returnx;} main(){

有以下程序 include<stdio.h> intfun(){ staticintx=1; x+=1: returnx;} main(){ inti,s=1; for(i=1;i<=5;i++)s+=fun(); printf(%d\n,s);} 程序运行后的输出结果是

A.11

B.21

C.6

D.120

点击查看答案
第4题
有以下程序: #include<stdio.h> main() {int a[5]={1,2,3,4,5),b[5]={0,2,1,3,o},i,s=
0; for(i=o;i<5;i++)s=s+a[b[i]]; printf(”%d\n”,s); } 程序运行后的输出结果是()。

A.6

B.10

C.11

D.15

点击查看答案
第5题
有以下程序段#include "stdio.h"main(){ int j,i,k=0; for(j=50;j<=60;j++) { if(!(k%10)) printf("\n"); for(i=2;i<j;i++)if(!(j%i)) break; if(i>=j-1) { printf("%d",j); k++;} }}程序执行后输出的结果是

A.5359

B.5953

C.3595

D.9535

点击查看答案
第6题
有以下程序:#include<iostream>using namespace std;class R{public:R(int r1,int r2){R1=r1;R2=

有以下程序: #include<iostream> using namespace std; class R { public: R(int r1,int r2) { R1=r1; R2=r2; } void print(); void print0const; private: int R1,R2; }; void R::print() { cout<<R1<<","<<R2<<endl; } void R::print() const { cout<<Rl<<","<<R2<<endl; } int main() { R a(5,4); const R b(20,52); b.print(); return 0; } 执行后的输出结果是()。

A.5,4

B.20,52

C.0,0

D.4,5

点击查看答案
第7题
以下程序:#include<stdio.h>#include<string.h>main(){char str[]="abcd\n\123\xab";printf("%d"

以下程序: #include<stdio.h> #include<string.h> main() {char str[]="abcd\n\123\xab"; printf("%d",(str)); } 运行后的输出结果是()。

A.10

B.9

C.7

D.14

点击查看答案
第8题
微信小程序里面只有通过以下哪个方法可以导入模块()。

A.import

B.module.import

C.require

D.include

点击查看答案
第9题
在编写红外数据接受程序时,需要调用红外类库的头文件,以下调用该头文件的程序正确的是?()

A.#includeIRremote.h

B.#includeIRremote

C.#include

D.#include‘IRremote.h’

点击查看答案
第10题
以下程序运行时,若从键盘输入:123<回车>。输出结果是#include <stdio.h>main(){ inti

以下程序运行时,若从键盘输入:1 2 3<回车>。输出结果是#include <stdio.h>main(){ int i=2,j=2,k=2; scanf("%d%*d%d",&i,&j,&k); printf("%d%d%d\n",i,j,k);}

点击查看答案
第11题
(10)以下程序运行后的输出结果是 【10】 。#include <stdio.h>main(){ int x=10,y=20,t=0;if(

(10)以下程序运行后的输出结果是 【10】 。

#include <stdio.h>

main()

{ int x=10,y=20,t=0;

if(x==y)t=x;x=y;y=t;

printf("%d %d\n",x,y);

}

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