标签:des style blog http color io os ar for
http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=1274
2.3 5.4 3.4
5.7
#include <iostream> using namespace std; class Complex { public: Complex(double r,double i) { rm=r; im=i; } friend double operator +(double &c1,Complex &c2); void display(); private: double rm,im; }; double operator+(double &c1,Complex &c2) { return double(c1+c2.rm); } int main() { double x,y,z,q; cin>>x>>y>>z; Complex c1(x,y); q=z+c1; cout<<q<<endl; return 0; }
面向对象程序设计上机练习十二(运算符重载)(SDUTOJ1274)
标签:des style blog http color io os ar for
原文地址:http://www.cnblogs.com/zhangmingcheng/p/4044289.html