#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
int i = 0 ,j = 0 ,c = 1 ;
printf("请输入两个数:");
scanf("%d%d",&i,&j);
int a = i ,b = j ;
while ( c != 0){ //使用辗转相除法
c = i % j;
i = j ;
j = c;
}
printf("最大公约数为:%d 最小公倍数为:%d",i , a * b /i);
return 0;
}