题解 | #最大公约数#
最大公约数
https://www.nowcoder.com/practice/20216f2c84bc438eb5ef05e382536fd3
#include <stdio.h>
int GongYue(int a,int b){
if(b == 0){
return a;
}else{
return GongYue(b, a % b);
}
}
int main() {
int a, b;
scanf("%d%d",&a,&b);
printf("%d",GongYue(a, b));
return 0;
}

查看14道真题和解析