fork download
  1. // Level 1 - Contest 2 - Question 2 - Solution 1.
  2. #include <iostream>
  3. #include <cmath>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. long long X = 0;
  10. long long Y = 0;
  11. // The maximum value for x and y is 10 ^ 5, so suppose that x = 10 ^ 5 and y = 10 ^ 5 so x * y = 10 ^ 10 which is bigger than INT_MAX.
  12. cin >> X >> Y;
  13.  
  14. cout
  15. << X << " + " << Y << " = " << X + Y << endl
  16. << X << " * " << Y << " = " << X * Y << endl
  17. << X << " - " << Y << " = " << X - Y << endl;
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0.01s 5280KB
stdin
100000 100000
stdout
100000 + 100000 = 200000
100000 * 100000 = 10000000000
100000 - 100000 = 0