int main()//最大公约数
{
int n = 0;
int m = 0;
int r = 0;
printf("请输入两个数字:");
scanf("%d %d", &n, &m);
while (n % m)//n取模m
{
r = n % m;
n = m;
m = r;
}
printf("最大公约数为:%d\n", m);
return 0;
}
int main()//最大公约数
{
int n = 0;
int m = 0;
int r = 0;
printf("请输入两个数字:");
scanf("%d %d", &n, &m);
while (n % m)//n取模m
{
r = n % m;
n = m;
m = r;
}
printf("最大公约数为:%d\n", m);
return 0;
}