首页 > 职业资格考试
题目内容 (请给出正确答案)
[主观题]

有以下程序: #include <stdio.h> main() {int i=1,j =2,k =3; if(i ++ == 1&&(j ==3

有以下程序: #include <stdio.h> main() { int i=1,j =2,k =3; if(i ++ == 1&&(j ==3 ‖ k ++ ==3) ) printf("% d % d % d \n" , i, j, k ); } 程序运行后的输出结果是()。

A.123

B.234

C.223

D.233

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“有以下程序: #include <stdio.h> main…”相关的问题
第1题
有以下程序:#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

点击查看答案
第2题
若有以下程序:#include <iostream>using namespace std;class point{private: int x, y;public:

若有以下程序: #include <iostream> using namespace std; class point { private: int x, y; public: point () { x=0; y=0; } void setpoint(int x1,int y1) { x=x1; y=y1;

A.12,12

B.5,5

C.12,5

D.5,12

点击查看答案
第3题
有如下程序:#include<iostream>using namespace std;Class A{public:A(){cout<<“A”;}~A(){cout<<

有如下程序: #include<iostream> using namespace std; Class A { public: A(){cout<<“A”;} ~A(){cout<<“~A”;} }; A*p; public: B(){cout<<“B”;p=new A;} ~B(){cout<<“~B”;delete p;} }; B obj; return 0; ) 执行这个程序的输出结果是(

A.BAA~A~B~A

B.ABA~B~A~A

C.BAA~B~A~A

D.ABA~A~B~A

点击查看答案
第4题
有下列程序:include<iostream>using namespace std;class ONE{ public:virtual void f(){COUt<<"

有下列程序:

include<iostream>

using namespace std;

class ONE

{

public:

virtual void f(){COUt<<"1";}

};

c1assTWO:public ONE

{

public:

TWO(){cout<<"2";}

};

class THREE:public TWO

{

pub

点击查看答案
第5题
有如下程序: #include<iostream> using namespace std; int main(){ int sum;

有如下程序: #include<iostream> using namespace std; int main(){ int sum; for(int i=0;i<6;i+=3){ sum=i; for(int j=i;j<6;j++)sum+=j; } cout<<sum<<end1; return 0; } 运行时的输出结果是()。

A.3

B.10

C.12

D.15

点击查看答案
第6题
有如下程序:#include<iostream>using namespace std;class Test{public:Test(){n+=2;}~Test(){n-

有如下程序: #include<iostream> using namespace std; class Test{ public: Test() {n+=2;} ~Test() {n-=3;} static int getNum(){return n;} private: static int n; }; int Test::n=1; int main() { Test* p=new Test; delete p; cout<<"n="<<Test::getNum()<<endl; return0; } 执行后的输出结果是()。

A.n=0

B.n=1

C.n=2

D.n=3

点击查看答案
第7题
有以下程序 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

点击查看答案
第8题
有以下程序:#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

点击查看答案
第9题
有以下程序#include<stdio.h>void fun(int P){int d=2;P=d++;printf(“%d”,P);}main(){int a=1;fun(A);prinff(“%.d\n”,A);}程序运行后的输出结果是

A.32

B.12

C.21

D.22

点击查看答案
第10题
有以下程序:#include<stdio.h>main(){int i,s=0; for(i=1;i<10;i+ =2) s+ =i+1; printf("%d\n",s

有以下程序: #include <stdio.h> main() { int i,s=0; for(i=1;i<10;i+ =2) s+ =i+1; printf("%d\n",s); } 程序执行后的输出结果是()。

A.正整数1~9的累加和

B.正整数1~10的累加和

C.正整数1~9中奇数之和

D.正整数1~10中偶数之和

点击查看答案
第11题
有以下程序#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

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