Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int max2(int a, int b) {
  5. if (a > b) return a;
  6. else return b;
  7. }
  8. int max4(int a, int b, int c, int d) {
  9. return max2( max2(a,b), max2(c,d) );
  10. }
  11.  
  12. int main() {
  13. int o,p,q,r;
  14. while (cin >> o >> p >> q >> r ) {
  15. cout << max4(o, p, q, r) << endl;
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement