#include<iostream>
using namespace std;
int max(int a,int b)
{
return a>b?a:b;
}
double max(double a,double b)
{
return a>b?a:b;
}
char max(char a,char b)
{
return a>b?a:b;
}
int main()
{
int a,b;
double x,y;
char c1,c2;
cin>>a>>b;
cout<<"整数比较,最大值是 "<<max(a,b)<<endl;
cin>>x>>y;
cout<<"浮点数比较,最大值是 "<<max(x,y)<<endl;
cin>>c1>>c2;
cout<<"字符比较,最大值是 "<<max(c1,c2)<<endl;
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: