#include<stdio.h>
int gcd(int x, int y)
{
if(y == 0) return x;
if(x < y) return gcd(y,x);
else return gcd(y, x%y);
}
int main(void)
{
int n1;int n2;
while(scanf("%d %d",&n1,&n2)!=EOF)
{
int Res = gcd(n1,n2);
printf("%d\n",Res);
}
}
gcd函数板子
最新推荐文章于 2023-09-24 11:34:03 发布