Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- template <typename T>
- T Max(T left, T right) {
- return left > right ? left : right;
- }
- int main() {
- setlocale(LC_ALL, "ru");
- int a = 5, b = 4;
- double c = 5.7, d = 9.4;
- cout << Max(a, b) << endl;
- cout << Max(c, d) << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement