1 #include <stdio.h> 2 int main() 3 { 4 int r,m,n; 5 printf("请输入m,n(用逗号间隔):"); 6 scanf("%d,%d",&m,&n); 7 r=m%n; 8 while(r!=0) 9 { 10 m=n; 11 n=r; 12 r=m%n;//r=n%r 13 } 14 printf("最大公约数:%d\n",n); 15 }
标签:m%,求解,公倍数,int,最大公约数,printf From: https://www.cnblogs.com/DF696/p/16890707.html