#include <iostream>
using namespace std;
template <class T>
float Large(T n1, T n2)
{
return (n1 > n2) ? n1 : n2;
}
int main() {
int a,b;
float c,d;
cin>>a>>b>>c>>d;
cout<<Large(a,b)<<endl<<Large(c,d);
return 0;
}
using namespace std;
template <class T>
float Large(T n1, T n2)
{
return (n1 > n2) ? n1 : n2;
}
int main() {
int a,b;
float c,d;
cin>>a>>b>>c>>d;
cout<<Large(a,b)<<endl<<Large(c,d);
return 0;
}
only 66%
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDelete/* works 100% just make the changes I've given in front of lines
ReplyDeleteas comments blogspot keeps cutting < brackets off. */
#include < iostream > //dont give space before and after iostream
using namespace std;
template< class T > //dont give space before and after class T
class largestno
{
public:
T Large(T n1,T n2)
{
return (n1 > n2) ? n1 : n2;
}
};
int main() {
largestno < int > t; //dont give space before and after int
largestno < float > u; //dont give space before and after float
int a,b;
float c,d;
cin>>a>>b>>c>>d;
cout<<t.Large(a,b)<<endl<<u.Large(c,d);
return 0;
}
100% working
DeleteThanks mate
Delete#include
ReplyDeleteusing namespace std;
template
float Large(T n1,T n2)
{
return (n1 > n2) ? n1 : n2;
}
int main() {
int a,b;
float c,d;
cin>>a>>b>>c>>d;
cout<<Large(a,b)<<endl<<Large(c,d);
return 0;
}