?? trapzint.h
字號:
//Trapzint.h 文件一,類聲明
#include <iostream>
#include <cmath>
using namespace std;
class F //抽象類F的聲明
{
public:
virtual double operator ()(double x) const=0; //純虛函數重載運算符()
};
class Fun:public F //公有派生類Fun聲明
{
public:
double operator()(double x) const //虛函數的內聯實現
{
return log(1.0+x)/(1.0+x*x); //被積函數
}
};
class Integ //抽象類Integ聲明
{
public:
virtual double operator ()(double a,double b,double eps) const=0;
};
class Trapz:public Integ //公有派生類Trapz聲明
{
public:
Trapz(const F&pf):f(pf){} //構造函數
double operator ()(double a, double b,double eps) const;
private:
const F &f; //私有成員,F類對象的指針
};
//End of file Trapzint.h
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -