// // main.c // a // // Created by rex on 16/9/14. // Copyright © 2016年 rex. All rights reserved. // #include <stdio.h> #include <string.h> #include <ctype.h> int main() { int a, b, c, d, e; scanf("%d %d", &a, &b); d = a; e = b; while(b) { c = a % b; a = b; b = c; } printf("%d %d\n", d * e / a, a); return 0; } |
Double click to view unformatted code.