#include <stdio.h> int main() { int m,n,p,temp; int r; scanf("%d %d",&m,&n); if(n<m) { temp = m; m = n; n = temp; } p = m*n; while(m!=0) { r = n % m; n = m; m = r; } printf("%d ",p/n); printf("%d",n); return 0; } |
Double click to view unformatted code.