#include <stdio.h>

int GCD(int a,int b) {
    if (a<b) {
        int tmp =a;
        a=b;
        b=tmp;
    }
    int r=a%b;
    while (r!=0) {
        a=b;
        b=r;
        r=a%b;
    }
    return b;
}

int main() {
    int a,b,gcd;
    scanf("%d %d",&a,&b);
    gcd = GCD(a,b);
    printf("%d",gcd);
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: