网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

下列程序的执行结果是( )。 #include<iostream.h> #include<stdlib.h> classTestClass { public: intX,y; TestClass(){x=y=0;} TestClass(inta,intb)(x=a;y=b;}voiddisp() { cout<<"x="<<x<<",y="<<y<<endl; } }; voidmain() { TestClasss1(2,3); s1.disp(); }

A.x=2,y=2

B.x=2,y=3

C.x=3,y=2

D.x=3,y=3


参考答案

更多 “ 下列程序的执行结果是( )。 #includeiostream.h #includestdlib.h classTestClass { public: intX,y; TestClass(){x=y=0;} TestClass(inta,intb)(x=a;y=b;}voiddisp() { cout"x="x",y="yendl; } }; voidmain() { TestClasss1(2,3); s1.disp(); }A.x=2,y=2B.x=2,y=3C.x=3,y=2D.x=3,y=3 ” 相关考题
考题 下列程序的执行结果是______。 include int a; int sum_a(void) { a=a+5; return a; 下列程序的执行结果是______。include<lostream.h>int a;int sum_a(void){a=a+5;return a;}void main(void){a=a+sum_a( );cout<<a<<endl;}

考题 下列程序的执行结果是______。 include include using namespace std; vo 下列程序的执行结果是______。include<iostream.h>include<iomanip.h>using namespace std;voidmain(){cout<<setfill('x')<<setw(10);cout<<"Hello"<<end1;}

考题 执行下列程序的结果是( )。 include void main() { char *str; str 执行下列程序的结果是( )。 #include<iostream.h> void main() { char *str; str="test!"; cout<<str[5]; }A.test!B.testC.空字符D.异常

考题 下列程序的执行结果是【 】。 include int a; int sum_a(void) { a=a+5; return a; } 下列程序的执行结果是【 】。include <iostream. h>int a;int sum_a(void){a=a+5;return a;}void main(void){a = a+sum_a();cout<<a<<endl;}

考题 下列程序执行的输出结果是()。 include main() {char a[2][4];strcpy(a,"are");strcpy( 下列程序执行的输出结果是( )。 #include<stdio.h> main() { char a[2][4]; strcpy(a,"are");strcpy(a [1],"you"); a[0][3]=''; printf("%s\n",a); }A.areyouB.youC.areD.

考题 执行下列程序后,屏幕上显示的结果是( )。A.2 3 4 5B.2 3 4 3C.4 5 4 5SXB 执行下列程序后,屏幕上显示的结果是( )。A.2 3 4 5B.2 3 4 3C.4 5 4 5D.2 3 2 3

考题 下列给定程序中,函数fun的功能是:将形参n中个位上为偶数的数取出,并按原来从高位到低位相反的顺序组成一个新数,作为函数值返回。例如,输入一个整数27638496,函数返回值为64862。请在程序的下划线处填入正确的内容并将下划线删除,使程序得出正确的结果。注意:部分源程序在文件BLANKl.C中。不得增行或删行,也不得更改程序的结构!include&lt;stdi0.h&gt;unsigned long fun(unsigned long n){unsigned long x=0;int t;

考题 下列给定程序中,函数fun的功能是:从低位开始依次取出长整型变量s中奇数位上的数,构成一个新数存放在t中。高位仍在高位,低位仍在低位。例如,当s中的数为7654321时,t中的数为7531。请改正程序中的错误,使它能得出正确的结果。注意:部分源程序在文件MODll.C中,不得增行或删行,也不得更改程序的结构!include&lt;stdi0.h&gt;

考题 下列程序执行的输出结果是( )。 include main() {char a[2][4];strcpy(a,"are");strcpy 下列程序执行的输出结果是( )。 #include<stdio.h> main() { char a[2][4]; strcpy(a,"are");strcpy(a[1],"you"); a[0][3]=''; printf("%s\n",a); }A.areyouB.youC.areD.

考题 下列程序执行的输出结果是()。 inClude main() {char a[2][4]; strcpy(a,"are");strcpy 下列程序执行的输出结果是( )。#inClude<stdio.h>main(){ char a[2][4];strcpy(a,"are");strcpy(a[1],"you");a[0][3]='';printf("%s\n",A) ;}A.areyouB.youC.areD.