解题思路:
注意事项:
参考代码:
#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分
1 人评分
C语言程序设计教程(第三版)课后习题11.5 (C语言代码)浏览:612 |
最长单词 (C语言代码)浏览:1355 |
C语言程序设计教程(第三版)课后习题8.3 (C语言代码)浏览:622 |
打水问题 (C语言代码)浏览:1055 |
WU-格式化数据输出 (C语言代码)浏览:1736 |
C语言程序设计教程(第三版)课后习题6.1 (C语言代码)浏览:687 |
Tom数 (C语言代码)浏览:525 |
C二级辅导-进制转换 (C语言代码)浏览:660 |
Hello, world! (C语言代码)浏览:808 |
陈教主的三角形 (C语言代码)浏览:1138 |