Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- template <class myType>
- myType GetMax (myType a, myType b) {
- return (a>b?a:b);
- }
- int SmallInt(int num1, int num2)
- {
- if(num1<num2)
- {
- cout << num2 <<" is bigger number that: " << num1;
- return num1;
- }
- else
- return num2;
- }
- double minD(double num1,double num2)
- {
- if(num1<num2)
- {
- cout << num2 <<" is bigger number that: " << num1;
- return num1;
- }
- else
- return num2;
- }
- int main()
- {
- int x, y;
- cin >> x;
- cin >> y;
- cout << GetMax(1,2 )<< endl;
- std::cout << GetMax(1.1,2.3)<<std::endl;
- int a = 0;
- double b =10.3;
- std::cout << GetMax<double>(a,b)<<endl;
- SmallInt(x,y);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement