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

阅读下面程序,写出输出结果。#include using namespace std ; class A { int a, b; public :

阅读下面程序,写出输出结果。#include using namespace std ; class A { int a, b; public :

阅读下面程序,写出输出结果。

#include using namespace std ; class A { int a, b; public : A() { a = b = 0; }

A(int aa, int bb) { a = aa; b = bb; cout << a << ' ' << b << endl ; } }; int main() { A x, y(2,3);

return 0; }

查看答案
答案
收藏
如果结果不匹配,请 联系老师 获取答案
您可能会需要:
您的账号:,可能还需要:
您的账号:
发送账号密码至手机
发送
安装优题宝APP,拍照搜题省时又省心!
更多“阅读下面程序,写出输出结果。#include using n…”相关的问题
第1题
写出下面程序运行时单击窗体的输出结果。Private Sub f(a%, b%)a = a + bb = a - bEnd SubPriva
写出下面程序运行时单击窗体的输出结果。Private Sub f(a%, b%)a = a + bb = a - bEnd SubPriva

写出下面程序运行时单击窗体的输出结果。

Private Sub f(a%, b%)

a = a + b

b = a - b

End Sub

Private Sub Form_Click()

Dim a%, b%

a = 23

b = 12

Call f(a, b)

Print "a=" & a; ",b=" & b

End Sub

点击查看答案
第2题
阅读下面事件过程,写出执行结果。Private Sub Command1_Click()Dim a%, b%, c%, s%, w%, t%a =
阅读下面事件过程,写出执行结果。Private Sub Command1_Click()Dim a%, b%, c%, s%, w%, t%a =

阅读下面事件过程,写出执行结果。

Private Sub Command1_Click()

Dim a%, b%, c%, s%, w%, t%

a = -1: b = 3: c = 3

s = 0: w = 0: t = 0

If c > 0 Then s = a + b

If a <= 0 Then

If c <= 0 Then

w = a - b

End If

Else

If c > 0 Then w = a - b Else t = c

End If

c = a + b

Print a, b, c

Print s, w, t

End Sub

点击查看答案
第3题
请先分析说明表达式(*p)++和*p++的不同含义,然后写出下面程序的运行结果。
请先分析说明表达式(*p)++和*p++的不同含义,然后写出下面程序的运行结果。

点击查看答案
第4题
阅读下列程序,请输出程序结果:longfac(intn)longf;if(n<0)cout<<"n<0"<elseif(n==0)

阅读下列程序,请输出程序结果:

longfac(intn)

longf;

if(n<0)cout<<"n<0"<

elseif(n==0)f=1;

elsef=fac(n-1)*n;

returnf;

}

voidmain()

longfac(intn);

intn=5;

longy;

y=fac(n);

cout<

点击查看答案
第5题
下面程序为变量x,y,z,赋初值2.5,然后在屏幕上打印这些变量的值。程序中存在错误,请改正错误,并
写出程序的正确运行结果

点击查看答案
第6题
下面程序的运行结果是()public class demo {public static void main(string[] args) {try {

A.编译失败

B.编译通过,没有结果输出

C.输出:除法正常运行

D.输出:除数不能为0

点击查看答案
第7题
在使用MapReduce程序WordCount进行词频统计时,对于文本行“hellohadoophelloworld”,经过WordCount程序的Map函数处理后直接输出的中间结果,应该是下面哪种形式()。

A.<"hello",1,1>、<"hadoop",1>和<"world",1>

B.<"hello",2>、<"hadoop",1>和<"world",1>

C.<"hello",<1,1>>、<"hadoop",1>和<"world",1>

D.<"hello",1>、<"hello",1>、<"hadoop",1>和<"world",1>

点击查看答案
第8题
阅读下列代码System.out.print ln(“Hello”+9+1);下列选项中,哪个是正确的输出结果()。
阅读下列代码System.out.print ln(“Hello”+9+1);下列选项中,哪个是正确的输出结果()。

A.Hello10

B.Hello91

C.An exception is thrown at run time

D.Compilation fails

点击查看答案
第9题
下面程序的功能是:根据输入的整数x和n,利用函数fact实...

下面程序的功能是:根据输入的整数x和n,利用函数fact实现求。 例如:输入:2,3 输出=8 请在程序中的横线上填入正确的内容,将程序补充完整。 /* c7-1.c 利用函数fact实现求x的n次方*/ #include "stdio.h" int main() { long int fact(long x,long n) ; /*声明fact函数*/ long int x ; long int n; printf("please enter X and N(>=0): "); scanf("%ld,%ld", &x, &n ); printf("%ld,%ld=%ld",x,n, (1) ); /*调用fact函数 */ return 0; } long int fact(long int x, long int n) /*定义fact函数求xn */ { long int i,s; (2) ; /*求累积变量的初始化*/ if (n= =0) return 0; for(i=1; i<=n; i++) *用循环实现xn* s="s*x;" (3) ; *返回结果xn*>

点击查看答案
第10题
阅读以下程序,给出运行结果。classA{publicstaticvoidmain(Stringargs[]){intj=0;for(inti=1;i<

阅读以下程序,给出运行结果。

classA{

publicstaticvoidmain(Stringargs[]){

intj=0;

for(inti=1;i<=10;i++){

j=j+i;

}

System.out.println("j="+j);

}

}

运行结果是:

点击查看答案
第11题
阅读以下程序,填写运行结果()。f=lambda x,y:x%y print(f(7,8))

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