fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. int biggest;
  7. int smallest;
  8. int num1;
  9. int num2;
  10. int num3;
  11.  
  12.  
  13. cin >> num1;
  14. cin >> num2;
  15. cin >> num3;
  16.  
  17. biggest = num1;
  18. smallest = num1;
  19.  
  20. if(num1 > biggest) biggest = num1;
  21. if(num1 < smallest) smallest = num1;
  22. if(num2 > biggest) biggest = num2;
  23. if(num2 < smallest) smallest = num2;
  24. if(num3 > biggest) biggest = num3;
  25. if(num3 < smallest) smallest = num3;
  26.  
  27. cout << biggest << endl;
  28. cout << smallest << endl;
  29.  
  30.  
  31. return 0;
  32. }
Success #stdin #stdout 0.01s 5268KB
stdin
9
1559
149
stdout
1559
9