#include <stdio.h>
int gcd(int a, int b)
{
if (b == 0)
return a;
else
return gcd(b, a % b);
}
int main()
{
int a, b;
printf("2つの整数を入力してください:");
scanf("%d %d", &a, &b);
printf("%dと%dの最大公約数は%dです。\n", a, b, gcd(a, b));
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: