#include<iostream>
using namespace std;
template <class T>
class compare
{
public:
compare(T a,T b)
{
x=a;y=b;
}
T max(){
return (x>y)?x:y;
}
T min();
private:
T x,y;
};
template<class T>
T compare<T>::min()
{
return (x>y)?y:x;
}
int main()
{
compare <int>cmp(3,7);
cout<<cmp.max();
compare <float>cmp1(1.2,3.4);
cout<<cmp1.min();
}
using namespace std;
template <class T>
class compare
{
public:
compare(T a,T b)
{
x=a;y=b;
}
T max(){
return (x>y)?x:y;
}
T min();
private:
T x,y;
};
template<class T>
T compare<T>::min()
{
return (x>y)?y:x;
}
int main()
{
compare <int>cmp(3,7);
cout<<cmp.max();
compare <float>cmp1(1.2,3.4);
cout<<cmp1.min();
}