正在加载图片...
第一节类和对象的基本概念 #include <iostream.h> #include <math.h> struct complex i double real double imag; void init(double r, double i f real=r;imag=i;) double realcomplex() return real,) double imagcomplex() ireturn imag; double abscomplexo) i double t; t=sqrt(real*real+imag*imag) return t)第一节 类和对象的基本概念 #include <iostream.h> #include <math.h> struct complex { double real; double imag; 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 高等教育资讯网 版权所有