#include<stdio.h> #include<math.h> #include<string.h> #include <stdlib.h> int main() { /* 从键盘输入一个整数n(1≤n≤9),打印出指定的数字图形。 */ int x , y , a , b , t ; scanf("%d %d" , &a , &b); x = a ; y = b; if( x < y ){ t = x; x = y; y = t; } do{ t = x % y; x = y; y = t; }while( y > 0 ); printf("%d %d" , a * b /x , x ); return 0; } |
Double click to view unformatted code.