#include<iostream>
#include<string>
using namespace std;
template <typename T>
T getMax(T v1,T v2,T v3)
{
if(v1>v2 && v1>v3)
{
return v1;
}
else if(v2>v3)
{
return v2;
}
else
{
return v3;
}
}
int main()
{
int a,b,c;
float a1,b1,c1;
char a2,b2,c2;
string a3="Yi",b3="yile",c3="hello";
cout<<"Enter 3 value: \n";
cin>>a>>b>>c;
cout<<"Enter 3 floats:\n";
cin>>a1>>b1>>c1;
cout<<"Enter 3 chars:\n";
cin>>a2>>b2>>c2;
cout<<"Enter 3 strings:\n";
cout<<"The biggest value is: "<<getMax(a,b,c)<<endl;
cout<<"The biggest floats is: "<<getMax(a1,b1,c1)<<endl;
cout<<"The biggest chars is: "<<getMax(a2,b2,c2)<<endl;
cout<<"The biggest chars is: "<<getMax(a3,b3,c3)<<endl;
system("pause");
}
I2luY2x1ZGU8aW9zdHJlYW0+CiNpbmNsdWRlPHN0cmluZz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnRlbXBsYXRlIDx0eXBlbmFtZSBUPgpUIGdldE1heChUIHYxLFQgdjIsVCB2MykKewoJCgkKCglpZih2MT52MiAmJiB2MT52MykKCXsKCQlyZXR1cm4gdjE7Cgl9CgllbHNlIGlmKHYyPnYzKQoJewoJCXJldHVybiB2MjsKCX0KCWVsc2UKCXsKCQlyZXR1cm4gdjM7Cgl9CgkKfQppbnQgbWFpbigpCnsKCWludCBhLGIsYzsKCWZsb2F0IGExLGIxLGMxOwoJY2hhciBhMixiMixjMjsKCXN0cmluZyBhMz0iWWkiLGIzPSJ5aWxlIixjMz0iaGVsbG8iOwoJY291dDw8IkVudGVyIDMgdmFsdWU6IFxuIjsKCWNpbj4+YT4+Yj4+YzsKCWNvdXQ8PCJFbnRlciAzIGZsb2F0czpcbiI7CgljaW4+PmExPj5iMT4+YzE7Cgljb3V0PDwiRW50ZXIgMyBjaGFyczpcbiI7CgljaW4+PmEyPj5iMj4+YzI7Cgljb3V0PDwiRW50ZXIgMyBzdHJpbmdzOlxuIj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