题解 | #最大公约数#
最大公约数
https://www.nowcoder.com/practice/20216f2c84bc438eb5ef05e382536fd3
#include <stdio.h> int main() { int m, n; while ((scanf("%d %d", &m, &n)) != EOF) { int l, k; if (m > n) { l = m; k = n; } else { l = n; k = m; } while (k != 0) { int temp = l % k; l = k; k = temp; } printf("%d\n", l); } return 0; }