1 using namespace std;
 2 int gys(int x,int y)//用递归求最大公约数 
 3 {
 4     if(y==0)
 5     {
 6         return x;
 7     }
 8     else
 9     {
10         return gys(y,x%y);
11     }
12 }
13 main()
14 {
15     int a,b;
16     cin>>a>>b;
17     cout<<gys(a,b);
18 }

 

相关文章:

  • 2021-07-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2021-12-07
  • 2021-11-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-21
  • 2021-10-07
  • 2022-12-23
  • 2021-07-16
  • 2021-06-07
相关资源
相似解决方案