正在加载图片...
第一节类和对象的基本概念 #include <iostream.h> #include <math. h> Class complex i private double real: double imag; public void init(double r, double i) I real=imag double realcomplex() [return real: 1 double imagcomplex() freturn imag: double abscomplex() i double t' t=sqrt(realreal+imag*imag); eturn to第一节 类和对象的基本概念 #include <iostream.h> #include <math.h> class complex { private: double real; double imag; public: void init(double r,double i) { real=r;imag=i;} double realcomplex( ) {return real;} double imagcomplex( ) {return imag;} double abscomplex( ) { double t; t=sqrt(real*real+imag*imag); return t;} };
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有