/*通过重载函数调用运算符实现下列数学函数的抽象
		
		f(x,y)=ax*x+by+c 
*/
#include <iostream>
using namespace std;

class Fun
{
public:
	int operator()(int x,int y)const;
};
int Fun::operator()(int x,int y)const
{
	int a,b,c;
	cin>>a>>b>>c;
	return a*x*x+b*y+c;
}
int main()
{
	Fun f;
	cout<<f(2,3)<<endl;
	system("pause");
	return 0;
}


相关文章:

  • 2021-06-26
  • 2021-11-16
  • 2021-11-17
  • 2022-03-08
  • 2022-01-14
  • 2022-12-23
  • 2021-09-16
  • 2022-01-11
猜你喜欢
  • 2021-06-19
  • 2022-12-23
  • 2021-12-09
  • 2021-10-16
  • 2022-01-19
  • 2022-12-23
相关资源
相似解决方案