#include <stdio.h>int GCD(int m, int n);int LCM(int m, int n);main(){ int m = 0, n = 0; scanf("%d %d",&m,&n); while(m != 0 && n != 0){ printf("GCD = %d, LCM = %d ",GCD(m,n),LCM(m,n)); scanf("%d %d",&m,&n); } }int LCM(int m, int n){ int lcm = 0; if(m>n){ lcm = m; } else lcm = n; while(lcm%m==0 && lcm%n==0){ lcm++; } return lcm;}int GCD(int m, int n){ int a = 0; int i = 0; int gcd = 0; if(m>n){ a = n; } else a = m; for(i = 0;i<=a;i++){ if(m%i==0&&n%i==0) gcd = i; } return gcd;}