#include<iostream>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
int c=(a>b?b:a);
for(int j=c;j>0;j--)
if(a%j==0&&b%j==0)
cout<<j<<endl;
return 0;
}
扫描二维码,关注牛客
下载牛客APP,随时随地刷题
全部评论
(4) 回帖