输入两个正整数m和n,求其最大公约数和最小公倍数.

问题描述:

输入两个正整数m和n,求其最大公约数和最小公倍数.

#include #include int main(void) {int m,n,r;int s;printf("输入两数:");scanf("%d %d",&m,&n);s = m * n;while(n != 0) {r = m % n;m = n;n = r;}printf("GCD:%d\n",m);printf("LCM:%d\n",s/m);//system("paus...