#include <iostream> using namespace std; int gcd(int a,int b) { int t; if(a<b) { t=a; a=b; b=t; } while(t=a%b) { a=b; b=t; } return b; } int main() { int a,b; while(cin>>a>>b) { cout<<gcd(a,b)<<endl; } return 0; }
最大公约数c++
猜你喜欢
转载自blog.csdn.net/qq_38534627/article/details/79691579
今日推荐
周排行