Ước chung lớn nhất (GCD)

View as PDF

Points: 3 (p) Time limit: 1.0s Memory limit: 256M Input: stdin Output: stdout

Bài 4: Ước chung lớn nhất (GCD)

  • Mô tả: Tìm GCD của hai số \(a, b\).
  • Dữ liệu vào: \(1 \le a, b \le 10^9\).
  • Ví dụ: Vào 24 18 -> Ra 6.
  • Yêu cầu: Dùng thuật toán Euclid với vòng lặp while.

Comments

Most recent
Loading comments...

There are no comments at the moment.