6
来源:互联网 发布:自贡汽车票订票软件 编辑:程序博客网 时间:2024/04/30 01:20
#include <iostream> using namespace std; class Complex {public: <img src="http://img.blog.csdn.net/20150503210338355?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvY2FpdGFf/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" /> Complex(){real=0;imag=0;} Complex(double r){real=r;imag=0;} Complex(double r,double i){real=r;imag=i;} operator double(){return real;} void display(); private: double real; double imag; }; void Complex::display() {cout<<"("<<real<<", "<<imag<<")"<<endl;} int main() {Complex c1(3,4),c2; double d1; d1=2.5+c1; cout<<"d1="<<d1<<endl; c2=Complex(d1); cout<<"c2="; c2.display(); return 0; }
0 0
- 6
- 6
- 6
- 6
- 6
- 6
- 6
- 6
- 6
- 6
- 6
- 6
- 6
- 6
- 6
- 6
- 6
- 6
- java多线程
- [转载]AWS使用小记之EC2(Elastic Compute Cloud)
- hihocoder:随机斐波那契
- ubuntu下utorrent使用
- IOCP模型与EPOLL模型的比较
- 6
- BinaryTree operation
- 无法debug断点跟踪JDK源代码——missing line number attributes的解决方法
- Codeforces 540E Infinite Inversions 离散化+树状数组
- Dialogue System for Unity文档中文对照版(简雨原创翻译)第三篇(口型,语音同步相关)
- 杭电ACM 2014:青年歌手大奖赛_评委会打分
- java this 关键字
- 查看 keystore文件的签名信息
- [LeetCode] Count and Say