题解 | #最大公约数#
最大公约数
http://www.nowcoder.com/practice/20216f2c84bc438eb5ef05e382536fd3
#include<cstdio>
int gcd(int a,int b)
{
if(a%b==0){
return b;
}
else{
return gcd(b,a%b);
}
}
int main(){
int a,b;
while(scanf("%d %d",&a,&b)!=EOF)
{
int ans=gcd(a,b);
printf("%d\n",ans);
}
}
顺丰集团工作强度 309人发布