1 #include <stdio.h> 2 #include <stdlib.h> 3 4 5 int main() { 6 int x, y, a, resu; 7 scanf("%d%d", &x, &y); 8 if(x>=y) { 9 a = x; 10 } 11 else { 12 a = y; 13 } 14 for( ;a >= x;a++) 15 { 16 if(a % x == 0 && a % y == 0){ 17 break; 18 } 19 } 20 resu = a/x + a/y - 2; 21 printf("%d %d", a, resu); 22 return 0; 23 }
原文:https://www.cnblogs.com/iamcoming/p/11729434.html