帮忙解决问题
#include<iostream>using namespace std;
class Max
{
public:
float maxnum(float,float);
float maxnum(int,int);
};
float Max::maxnum(float a,float b)
{
if(a>b)
return a;
else
return b;
}
float Max::maxnum(int c,int d)
{
if(c>d)
return c;
else
return d;
}
void main()
{
Max m;
float x,y;
int p,q;
cout<<"Enter two float data type values:";
cin<<x<<y;
cout<<"Enter two integer data type values:";
cin<<p<<q;
cout<<"\nMaximum of 2 float values:"<<m.maxnum(x,y);
cout<<"\nMaximum of 2 integer values:"<<m.maxnum(p,q);
}