Advertisement
JosepRivaille

X59678: Mínim de tres enters diferents

Feb 22nd, 2015
373
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. //Precondició: Llegeix tres enters
  5. //Postcondició: En retorna el mínim
  6.  
  7. int main() {
  8.     int x, y, z;
  9.     cin >> x >> y >> z;
  10.     if (x <= y && x <= z) cout << x << endl;
  11.     else if  (y <= x && y <= z) cout << y << endl;
  12.     else if (z <= x && z <= y) cout << z << endl;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement