#include
using namespace std;
int main()
{
int x,y,m;
cin>>x>>y;
void fax(int,int,int);
int sum(int,int);
int max1(int,int);
fax(sum(x,y),x,y);
fax(max1(x,y),x,y);
return 0;
}
void fax(int (*p)(int,int),int a,int b)
{
int result;
result=(*p)(a,b);
//return result;
cout<<result<<endl;
}
int sum(int a,int b)
{
return a+b;
}
int max1(int a,int b)
{
return a>b?a:b;
}
把
void fax(int (*p)(int,int),int a,int b);
int sum(int a,int b);
int max1(int a,int b);
添加到int main前面
#include<bits/stdc++.h>
using namespace std;
void fax(int (*p)(int,int),int a,int b);
int sum(int a,int b);
int max1(int a,int b);
int main()
{
int x,y,m;
cin>>x>>y;
void fax(int,int,int);
int sum(int,int);
int max1(int,int);
fax(sum(x,y),x,y);
fax(max1(x,y),x,y);
return 0;
}
void fax(int (*p)(int,int),int a,int b)
{
int result;
result=(*p)(a,b);
//return result;
cout<<result<<endl;
}
int sum(int a,int b)
{
return a+b;
}
int max1(int a,int b)
{
return a>b?a:b;
}