Advertisement
Guest User

minmax

a guest
Mar 21st, 2015
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int min(int a, int b){return (a > b) ? b : a;}
  6. int max(int a, int b){return (a > b) ? a : b;}
  7. int main()
  8. {
  9. int a, b, c, d;
  10. cin >> a >> b >> c >> d;
  11. cout << min(min(a, b), min(c, d)) << "\t" << max(min(a, b), min(c, d)) << "\t" << min(max(a, b), max(c, d)) << "\t" << max(max(a, b), max(c, d));
  12. system("pause");
  13. return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement