注意:此页面搜索的是所有试题
题目内容
(许昌学院面向对象程序设计)
[分析题,4分] #include ”iostream.h”class three{ int x,y,z; public: three(int a,int b,int c){ x=a;y=b;z=c;} friend ostream &operator<<(ostream &output, three ob); };ostream &operator<<(ostream &output, three ob){ output<<ob.x<<’,’<<ob.z<<’,’<<ob.y<<endl; return output;}main(){ three obj1(10,20,30); cout<<obj; three obj2(50,40,100);cout<<obj2; }
参考答案