4 条题解
-
0
#include #include #include #include #include #include #include #include using namespace std; const int INF = 0x3f3f3f3f; int main() { int a , b; while(cin >> a >> b) { int sum = a * b; while(b != 0) { int r = a % b; a = b; b = r; } cout << a << " " << sum / a << endl; } return 0; }
-
0
/***************************************** 备注: ******************************************/ #include <math.h> #include <stdio.h> #include <iostream> #include <string.h> using namespace std; int main() { int a,b; while(cin >> a >> b) { int sum = a* b; while(b != 0) // 辗转相除法 { int r = a%b; a = b; b = r; } cout << a << " " << sum/a << endl;; } }
- 1
信息
- ID
- 977
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 6
- 标签
- 递交数
- 593
- 已通过
- 174
- 上传者