Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int max2(int a, int b) {
- if (a > b) return a;
- else return b;
- }
- int max4(int a, int b, int c, int d) {
- return max2( max2(a,b), max2(c,d) );
- }
- int main() {
- int o,p,q,r;
- while (cin >> o >> p >> q >> r ) {
- cout << max4(o, p, q, r) << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement