fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int a,b,x,y;
  5. scanf("%d %d", &a, &b);
  6.  
  7. x = a; //x lưu giá trị của a
  8. y = b; //y lưu giá trị của b
  9.  
  10. while(y != 0) {
  11. int res = x%y;
  12. x = y;
  13. y = res;
  14. }// phần này tính gcd(a,b) nhưng
  15. // anh dùng x y để thay cho a b
  16.  
  17. printf("%d", a*b/x);
  18. }
Success #stdin #stdout 0s 5312KB
stdin
20 15
stdout
60