#include <iostream>
using namespace std;
unsigned int gcd(unsigned int a,unsigned int b){
int k=0;
while(((a|b)&1)==0){
a=a>>1;
b=b>>1;
k++;}
while((a&1)==0){
a=a>>1;}
while(b!=0){
while((b&1)==0){
b=b>>1;}
if(a>b){
unsigned int temp=a;
a=b;
b=temp;}
b=b-a;}
return (a<<k);}
int main()
{
unsigned int a,b;
cin>>a>>b;
cout<<gcd(a,b);
}
09-08
05-19
5394
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)