最大公约数:
int gcd(int a,int b){//Greatest common divisor int c; while(b){ c=a%b; a=b; b=c; int t=0; } return a; }
最小公倍数:
int lcm(int a,int b){//least common multiple return a*b/gcd(a,b); }
标签:div pre gre multiple 最小公倍数 post blog a* class
最大公约数:
int gcd(int a,int b){//Greatest common divisor int c; while(b){ c=a%b; a=b; b=c; int t=0; } return a; }
最小公倍数:
int lcm(int a,int b){//least common multiple return a*b/gcd(a,b); }
标签:div pre gre multiple 最小公倍数 post blog a* class
原文地址:https://www.cnblogs.com/TQCAI/p/8455364.html