fork download
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4. int main()
  5. {
  6. int a, b, i, c = 0, e;
  7. cin >> a >> b;
  8.  
  9. e = b;
  10. if (b < 0)
  11. e = -b;
  12. for (i = 1; i <= e; ++i)
  13. c = c + a;
  14. if (b < 0)
  15. c = -c;
  16. cout << c;
  17. return 0;
  18. }
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
Standard output is empty