下列程序中声明了两个类AA和BB,其中函数“print”是类AA的成员函数,但是类BB的友元函数。
请在①、②和⑧处各填入正确的内容,使程序能正常运行。
#include<iostream.h>
[12] ;
class AA
int t;
public:
AA(int x)t=x;
void print(BB &b) ;
;
class BB
int s;
public:
BB(int y)s=y;
friend void [13] print(BB &);
;
void [14]
cout<<"AA:"<<t<<"BB: "<<w.s<<end1;<
void main( )
AA m(6);
BB n(8);
m.print(n);
输出结果为:AA:6;BB:8
题库:计算机等级考试
类型:填空题
时间:2017-07-03 15:45:40
免费下载:《填空》Word试卷
下列程序中声明了两个类AA和BB,其中函数“print”是类AA的成员函数,但是类BB的友元函数。
请在①、②和⑧处各填入正确的内容,使程序能正常运行。
#include<iostream.h>
[12] ;
class AA
int t;
public:
AA(int x)t=x;
void print(BB &b) ;
;
class BB
int s;
public:
BB(int y)s=y;
friend void [13] print(BB &);
;
void [14]
cout<<"AA:"<<t<<"BB: "<<w.s<<end1;<
void main( )
AA m(6);
BB n(8);
m.print(n);
输出结果为:AA:6;BB:8
本题关键词:融资类保函,风险函数,功效函数图,中标函,骨髓巨核细胞数和分类,数脉类脉象,监理中标函,保函,AA-PNH综合征,白细胞分类计数;