解题思路:
注意事项:
参考代码:
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
int gcd(int x,int y)//求最大公约数函数
{
int t;
while(y)
{
t=x%y;
x=y;
y=t;
}
return x;
}
int main()
{
int m,n;
scanf("%d%d",&n,&m);
printf("%d %d",gcd(n,m),n*m/gcd(n,m));
return 0;
}
0.0分
0 人评分
高精度加法 (C++代码)(大数加法)浏览:915 |
C语言训练-字符串正反连接 (C语言代码)浏览:617 |
A+B for Input-Output Practice (V) (C++代码)浏览:450 |
母牛的故事 (C语言代码)浏览:435 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:633 |
上车人数 (C语言代码)浏览:767 |
C语言程序设计教程(第三版)课后习题1.6 (C++代码)浏览:889 |
wu-淘淘的名单 (C++代码)浏览:1329 |
C语言程序设计教程(第三版)课后习题8.4 (C语言代码)浏览:520 |
C语言程序设计教程(第三版)课后习题12.2 (C语言代码)浏览:753 |