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

题目内容 (请给出正确答案)
以下程序运行后的输出结果是______。includeinclude usingnamespacestd;classY

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

include <iostream>

include <string>

using namespace std;

class Y;

class X

{

int x;

char *strx;

public:

X(int a, char *str)

{

x=a;

strx=new char[strlen(str)+1]

strcpy (strx,str);

}

void show(Y &ob);

};

class Y

{

prlvate:

int y;

char *stry;

public:

Y(int b,char *str)

{

y=b;

stry=new char[strlen(str)+1];

strcpy(stry,str);

}

friend void X::show(Y &ob);

};

void X::show{Y &ob)

{

cout<<strx<<",",

cout<<ob.stry<<endl;

}

int main{

{

X a (10, "stringX");

Y b (20, "stringY");

a. show (b);

renurn 0;

}


参考答案

更多 “ 以下程序运行后的输出结果是______。includeinclude usingnamespacestd;classY 以下程序运行后的输出结果是______。include <iostream>include <string>using namespace std;class Y;class X{int x;char *strx;public:X(int a, char *str){x=a;strx=new char[strlen(str)+1]strcpy (strx,str);}void show(Y ob);};class Y{prlvate:int y;char *stry;public:Y(int b,char *str){y=b;stry=new char[strlen(str)+1];strcpy(stry,str);}friend void X::show(Y ob);};void X::show{Y ob){cout<<strx<<",",cout<<ob.stry<<endl;}int main{{X a (10, "stringX");Y b (20, "stringY");a. show (b);renurn 0;} ” 相关考题
考题 下列程序的输出结果是______。 include include using namespace std; voi 下列程序的输出结果是______。include<iostream.h>include<string.h>using namespace std;void fun(const char*s,char C) {c=s[strlen(s)/2];}int main(){char str[]="ABCDE";char ch=str[1];fun(str,ch);cout<<ch;return 0;}

考题 以下程序运行后的输出结果是【】。 include using namespace std; int main() {int i=10, 以下程序运行后的输出结果是【 】。include<iostream>using namespace std;int main(){int i=10,i:0;do{j=j+i;i--;}while(i>2);cout<<j<<end1;return 0;}

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

考题 下面程序运行输出的结果是【】。 include using namespace std; int main(){char a[]="C 下面程序运行输出的结果是【 】。include <iostream>using namespace std;int main(){char a[]="Chinese";a[3]='\0';cout<<a<<endl;return 0;}

考题 以下程序的运行结果是【】。 include include using namespace std; void main() 以下程序的运行结果是【 】。include<iostream>include<string>using namespace std;void main(){chara[10]="China",b[]="Chin",c[]="ese";cout<<strlen(strcat(strcpy(a,b),c))<<endl;}

考题 有以下程序: include include using namespace std; int main() {char arr[ 有以下程序: #include<iostream> #include<string> using namespace std; int main() { char arr[2][4]; strcpy(arr[0],"you"); strcpy(arr[1],"me"); arr[0][3]=''; cout<<arr[0]<<end1; return 0; } 执行后的输出结果是( )。A.youmeB.youC.meD.err

考题 有以下程序:include include using namespace std;int main ( ){ char b1[8 有以下程序: #include <iostream> #include <string> using namespace std; int main ( ) { char b1[8] = "abcdefg"; char b2[8],*pb=b1+3; while (--pb>=b1) strcpy (b2, Pb) ; cout<<strlen (b2) <<end1; return 0; } 程序运行后的输出结果是( )。A.8B.3C.1D.7

考题 有以下程序:include include using namespace std;class Y;class X{private 有以下程序: #include <iostream> #include <string> using namespace std; class Y; class X { private: int x; char *strx; public: X(int a, char *str) { x=a; strx=new char[strlen(str)+1]; strcpy(strx,str); } void show(Y ob) ; }; class Y { private: int y; char *stry; public: Y(int b,char *str) { y=b; stry=new char[strlen(str)+1]; strcpy(stry, str); } friend void X: :show(Y ob) ; }; void X: :show(Y ob) { cout<<strx<<", "; cout<<ob, stry<<end1; } int main ( ) { X a(10,"X"); Y b (20, "Y"); a. show(B) ; return 0; } 执行后的输出结果是( )。A.X,YB.a,bC.X,XD.Y,Y

考题 【单选题】以下程序运行后的输出结果是_____。#include <iostream>using namespace std;void main(){ char m; m='B'+32; cout<<m<<endl;}A.BB.bC.66D.98