64,654
社区成员
发帖
与我相关
我的任务
分享
#include "stdafx.h"
double bery(int);
double pum(int);
void estimate(int lines,double (*pf)(int));
int _tmain(int argc, _TCHAR* argv[])
{
using namespace std;
int a;
cin>>a;
cout<<estimate(a,bery)<<endl;
cout<<estimate(a,pum)<<endl;
return 0;
}
double bery(int a)
{
return a*5;
}
double pum(int a)
{
return a+5;
}
void estimate(int lines,double(*pf)(int))
{
using namespace std;
cout<<lines<<"will take"<<endl;
cout<<(*pf)(lines)<<" check!"<<endl;
}