求最大公约数的问题
程序代码:
#include<stdio.h> void main() { int GCD=1,m,n,i,LCM; printf("please enter two integer m,n:"); scanf("%d,%d",&m,&n); for(i=2;(i<m)&&(i<n);i++) while((m%i==0)&&(n%i==0)) GCD*=i; LCM=m*n/GCD; printf("The greatest common divisor is %d\nThe lowest common multiple is %d\n",GCD,LCM); }下面是我编的,不知道为什么算不出的,想问哪里错了?