求两个数的最大的公约数 辗转相除法 #include <stdio.h> #include <stdlib.h> /* 求两个数的最大的公约数 辗转相除法*/ int main(){ int m,n,r,t; scanf("%d%d",&m,&n); if(m<n){ t=m; m=n; n=t; } r=m%n; while(r!=0){ m=n; n=r; r=m%n; } printf("%d",n); } 运行结果