求最大公约数

#include <stdio.h>
int main(){
        int m,n;
        scanf("%d %d",&m,&n);
        while(m!=n){
                if(m>n){
                        m=m-n;
                }else{
                        n=n-m;
                }
        }
        printf("%d",m);
}
全部评论

相关推荐

评论
点赞
1
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务