complex类
来源:百度文库 编辑:神马文学网 时间:2024/04/28 15:41:54
//主文件m.cpp
#include
#include "complex.h"
using namespace std;
void main()
{
double f;
complex c1(1,1);
f=c1.abs();
cout<}
//complex.h
#if !defined complex_h
#define complex_h
class complex
{
double real;
double image;
public:
complex();
complex(double,double);
complex(const complex&);//拷贝构造函数
double abs();
}; #endif
//complex.cpp
#include "complex.h"
#include
complex::complex()
{
real=0;
image=0;
}
complex::complex(double r,double i)
{
real=r;
image=i;
}
complex::complex(const complex&c)
{
real=c.real;
image=c.image;
}
double complex::abs()
{
return sqrt(real*real+image*image);
}
#include
#include "complex.h"
using namespace std;
void main()
{
double f;
complex c1(1,1);
f=c1.abs();
cout<
//complex.h
#if !defined complex_h
#define complex_h
class complex
{
double real;
double image;
public:
complex();
complex(double,double);
complex(const complex&);//拷贝构造函数
double abs();
}; #endif
//complex.cpp
#include "complex.h"
#include
complex::complex()
{
real=0;
image=0;
}
complex::complex(double r,double i)
{
real=r;
image=i;
}
complex::complex(const complex&c)
{
real=c.real;
image=c.image;
}
double complex::abs()
{
return sqrt(real*real+image*image);
}
complex类
Complex Origami Diagrams
变态的日剧《LOVE COMPLEX》!
Chapter 1: Requirements of Complex Product Development
Chapter 1: Requirements of Complex Product Development
Shooting reported near Pentagon, complex locked down
Anatomy of a Complex Realtime System
complex 大智慧公式编写教程
网络视图 A visual exploration on mapping complex networks
A Build System for Complex Projects: Part 5
A Build System for Complex Projects: Part 4
A Build System for Complex Projects: Part 3
A Build System for Complex Projects: Part 1
Hypothesized performance on complex tasks as a function of scaled instructional strategies
CRect类(矩形类)
CRect类(矩形类)
小雨--边界类、控制类、实体类
小雨--边界类、控制类、实体类
小雨--边界类、控制类、实体类
素菜类
素菜类
Person类
技术类
Popup 类