竞赛
考级
#include<bits/stdc++.h> using namespace std; int a,b; int fun(int x,int y) { if(y==0) return x; return fun(y,x%y); } int main() { cin>>a>>b; cout<<fun(a,b); return 0; }
丁琪轩dingqx
#include<iostream> using namespace std; int gcd(int a,int b){ if(a%b==0) return b; return gcd(b,a%b); } int main(){ int a,b; cin>>a>>b; cout<<gcd(a,b); return 0; }
ACGO
zsy
include <bits/stdc++.h> using namespace std; int f(int a,int b) { if(a%b==0) return b; else return f(b,a%b); } int main() { int a,b; cin>>a>>b; cout<<f(a,b); return 0; }
one洪文
156****1040
__gcd()专门用来计算最大公约数
😋🙀😡😤
复仇者_shazi一只
正常写法 正常写法2
科技起源
or or
烙铁
THUNDER
澈朔
过于简单了
𝓤.𝓜.𝓚.𝓚.𝓢
import math as m x,y=map(int,input().split()) print(m.gcd(x, y))
无敌的鳖佬仔给老爷爷ccb
在?
JM搜91
艾尔海森
༺ཌༀ元气满满ༀད༻
#include<iostream> #include<cmath> using namespace std; int f(int a,int b){ if(b==0) return a; return f(b,a%b); } int main(){ int a,b; cin>>a>>b; cout<<f(a,b); return 0; }
余*杰
136****4819
WA君
共44条