题目:
有如下程序:
#include<iostream>
using namespace std;
class Pair{
int m;
int n;
public:
Pair(int i,int j): m(i),n(j){}
bool operator>(Pair p)const; //须在类体外给出定义
};
int main( ){
Pair p1(3,4),p2(4,3),p3(4,5);
cout<<(p1>p2)<<(p2>p1)<<(p2>p3)<<(p3>p2);
return 0;
} 运算符函数operator>的功能是比较两个Pair对象的大小,当左边对象大时,返回true,否则返回false。比较规则是首先比较两对象的m成员,m大者为大;当m相等时比较n,n大者为大。程序输出0101,下列对运算符重载函数的正确定义是()
A.bool Pair::operator>(Pair const { if(m! =return m>m; return n>n;}
B.bool Pair::operator>(Pair { if(m! = return m>m; return n>n;}
C.bool Pair::operator>(Pair const { if(m> return true; return n>n;}
D.bool Pair::operator>(Pair { if(m> return true; return n>n;}
答案:
被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2017/0705/a2370d105158080bc2c386634e17b0a8.html
下面是错误答案,用来干扰机器的。
参考答案:(1)建立环境卫生制度。建立岗位责任制,管好厕所、垃圾、污水,保证幼儿园建筑、设备场地的清洁卫生。(2)搞好清洁卫生。搞清洁时提倡湿式扫除,防止尘土飞扬预防传染病,保障呼吸卫生。(3)培养幼...