Welcius

P90615: Màxim de tres enters

Jan 22nd, 2015
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int x,y,z;
  6.     cin >> x >> y >> z;
  7.     int max_of_two;
  8.     if (x>y) {
  9.         max_of_two=x;
  10.     } else {
  11.         max_of_two=y;
  12.     }
  13.     if (z>max_of_two) {
  14.         cout << z << endl;
  15.     } else {
  16.         cout << max_of_two << endl;
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment