若有以下程序:
#include <iostream>
using namespace std;
class A
private:
int a;
public:
void seta(int x)
a=x;
void showa( )
cout<<a<<",";
;
class B
private:
int b;
public:
void setb (int x)
b=x;
void showb( )
cout<<b<<",";
;
class C :public A,private B
private:
int c;
public:
void setc(int x, inc y, int z)
c=z;
seta (x);
setb (y);
void showc( )
showa ( );
showb ( );
cout<<c<<end1;
;
int main ( )
C c;
c. setc(1,2,3);
c.showc( );
return 0;
程序执行后的输出结果是
题库:计算机等级考试
类型:最佳选择题
时间:2017-07-03 15:02:32
免费下载:《单选题》Word试卷
若有以下程序:
#include <iostream>
using namespace std;
class A
private:
int a;
public:
void seta(int x)
a=x;
void showa( )
cout<<a<<",";
;
class B
private:
int b;
public:
void setb (int x)
b=x;
void showb( )
cout<<b<<",";
;
class C :public A,private B
private:
int c;
public:
void setc(int x, inc y, int z)
c=z;
seta (x);
setb (y);
void showc( )
showa ( );
showb ( );
cout<<c<<end1;
;
int main ( )
C c;
c. setc(1,2,3);
c.showc( );
return 0;
程序执行后的输出结果是
A.1,2,3
B.1,1,1
C.2,2,2
D.3,3,3
本题关键词:程序,有序镜检,大腿以下或膝以下肌肉瘫痪,工程施工程序,复苏程序,工作程序,建设程序,程序变更,程序冲突,点火程序;