首页 > 自考
题目内容 (请给出正确答案)
[主观题]

有以下程序: #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

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

有以下程序 include <lostream> using namespace std; int main() { int i=010,j=10; cout<<(i)<<","<<j--<<endl; return 0; } 则该程序运行后的输出结果是【 】。

点击查看答案
第2题
以下程序的功能是求两个非0整数相除的商和余数。程序有几处错误,试找出它们加以修改,并上机验证修改结果。 #include iostream using namespace std; int main() {int x,y,r1,r2; cin>>x>>y; if(x=0||y=0..

以下程序的功能是求两个非0整数相除的商和余数。程序有几处错误,试找出它们加以修改,并上机验证修改结果。 #include "iostream" using namespace std; int main() {int x,y,r1,r2; cin>>x>>y; if(x=0||y=0) cout<<”input else { if(x> y) r1=x/y; r2=x%y; else r1=y/x; r2=y%x; } cout<<”商=> <<” 余数="”<"> < <endl; system("pause"); return 0;>

点击查看答案
第3题
有如下程序:#include<iostream>using namespace std;class B{public:Virtual void show(){cout<<

有如下程序: #include<iostream> using namespace std; class B{ public: Virtual void show(){cout<<“B”;} }; class D:publicB{ public: void show(){cout<<“D”;} }; void funl(B*ptr){ptr->show();} void{un2(B&ref){ref.show();} void

A.BBB

B.BBD

C.DBB

D.DBD

点击查看答案
第4题
有如下程序:#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; return 0; } 执行后的输出结果是()

A.n=0

B.n=1

C.n=2

D.n=3

点击查看答案
第5题
下列程序的输出结果是______。 include<iostream> using namespace std; void fun(int &rf) {

下列程序的输出结果是______。

include<iostream>

using namespace std;

void fun(int &rf)

{

rf*=2;

}

int main()

{

int num=500;

fun(num);

cout<<num<<endl;

return 0;

}

点击查看答案
第6题
有以下程序()

A.#include

B.0

C.-1

D.1

E.7

点击查看答案
第7题
有以下程序()

A.#include

B.x=4

C.x=8

D.x=6

E.x=12

点击查看答案
第8题
有以下程序#include<stdio.h>main(){char s[]="159",*P;p=s;printf("%C",*p++);printf("%C",*p++

有以下程序

#include<stdio.h>

main()

{char s[]="159",*P;

p=s;

printf("%C",*p++);

printf("%C",*p++);

}

程序运行后的输出结果是______。

点击查看答案
第9题
有以下程序 include<stdio.h> deftneN2 defineMN+1 defineNUM(M+1)*M/2 main(){printf(

有以下程序 include<stdio.h> deftneN2 defineMN+1 defineNUM(M+1)*M/2 main(){printf(%d\n,NUM);) 程序运行后的输出结果是

A.4

B.8

C.9

D.6

点击查看答案
第10题
有以下程序#include<stdio.h>main(){int a=7; while(a--); printf("%d\n",a);}程序运行后

有以下程序

#include<stdio.h>

main()

{ int a=7;

while(a--);

printf("%d\n",a);

}

程序运行后的输出结果是

A.-1

B.0

C.1

D.7

点击查看答案
第11题
有以下程序 include<stdio.h> yoidfun(char**p) {++p;printf(%sha,*p);} main() {char*

有以下程序 include<stdio.h> yoidfun(char**p) {++p;printf(%sha,*p);} main() {char*a[]=(Morning,Aftemoon,Eyening,Night); fun(a); } 程序的运行结果是

A.ffemoon

B.Morning

C.oming

D.Afternoon

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