andy6804tw
10/12/2016 - 2:23 AM

http://e-tutor.itsa.org.tw/e-Tutor/mod/programming/view.php?id=30757

#include<stdio.h>  
int main()  
{  
    int a,b;  
    scanf("%d%d",&a,&b);  
    while((a%=b)&&(b%=a));  
    printf("%d\n",a+b);  
    return 0;  
}