这题主要介绍了如何应用函数指针。这一章感觉最难的就是这个,不过题目比较简单。
//according to the topic finish the functions
#include
using namespace std;
double add(double,double);
double mean(double,double);
double differ(double,double);
double calculate(double,double,double (*pf)(double,double));
int main()
{
double x,y;
cout<<"Enter two numbers(q to quit): ";
while(cin>>x>>y)
{
cout<<"Sum = "<
<