fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main(void) {
  5. // your code goes here
  6. /* the two numbers */
  7. int number1,number2;
  8.  
  9. /* we will save the larger number here */
  10. int max;
  11.  
  12. /*read two numbers */
  13. cin >> number1;
  14. cin >> number2;
  15.  
  16. /* we temporarily assume that the former number is the larger one */
  17. /* we will check it soon */
  18. max = number1;
  19.  
  20. /* we check if the assumption was false */
  21. if(number2 > max)
  22. max = number2;
  23.  
  24. /* we print the result */
  25. cout << "The larger number is " << max << endl;
  26.  
  27. /* we finish the program successfully */
  28. return 0;
  29. }
Success #stdin #stdout 0s 4292KB
stdin
9
1
stdout
The larger number is 9