1、#include "iostream"#include "h"using namespace std ;class F{public : virtual double operator ()( double x ) const = 0 ;};class Fun: public F{public : double operator()( double x) const { return log( 0 + x ) / ( 0 + x*x ) ; }};class Integ{public : virtual double operator()( double a , double b, double eps ) const = 0 ;};class Trapz : public Integ{public : Trapz( const F &pf ) : f( pf ) {} double operator ()( double a ,double b , double eps ) const ;private: const F &f ;} ;2、#include "h"#include "Th"double Trapz::operator ()( double a ,double b , double eps ) const { int done ( 0 ) ; int n ; double h, Tn, T2n ; n = 1 ; h = b - a ; Tn = h * ( f( a ) + f( b ) ) / 0 ; while( !done ) { double temp( 0 ) ; for ( int k = 0 ; k < n ; k++ ) { double x = a + ( k + 5 ) * h ; temp += f( x ) ; } T2n = ( Tn + h * temp ) / 0 ; if ( fabs( T2n - Tn ) < eps ) done = 1 ; else { Tn = T2n ; n *= 2 ; h /= 2 ; } } return T2n ;}3、#include "h"#include "Th"#include "iomanip"int main(){ Fun f ; Trapz trapz1( f ) ; cout << " TRAPZ Int :" <