fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int a,b,r,c,d,f;
  8.  
  9. cin >> a >> b;
  10. d=a;
  11. f=b;
  12.  
  13. while(b!=0)
  14. {
  15. r = a % b;
  16. a = b;
  17. b = r;
  18. }
  19.  
  20. c=(d*f)/a;
  21.  
  22.  
  23. cout << c<< endl;
  24.  
  25. return 0;
  26. }
Success #stdin #stdout 0.01s 2684KB
stdin
31
50
stdout
1550