#include   <iostream>
int main()
{
    using namespace std;
int m, n;
cin >> n >> m;
    while (m != n)
    {
        while (m>n) { m = m - n; }
        while (n>m) { n = n - m; }
    }
    printf("%d\n", m);
    system("pause");
    return 0;
}

运行结果:

辗转相减求最大公约数

相关文章:

  • 2021-12-07
  • 2022-12-23
  • 2022-12-23
  • 2021-04-14
  • 2021-08-23
  • 2021-08-17
  • 2021-11-08
猜你喜欢
  • 2021-07-31
  • 2022-01-26
  • 2021-12-30
  • 2021-12-15
  • 2022-12-23
相关资源
相似解决方案