解题思路:
注意事项:
参考代码:
#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 人评分
点我有惊喜!你懂得!浏览:1250 |
妹子杀手的故事 (C语言代码)浏览:707 |
2003年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:638 |
C二级辅导-计负均正 (C语言代码)浏览:680 |
C语言程序设计教程(第三版)课后习题8.5 (C语言代码)浏览:603 |
C语言程序设计教程(第三版)课后习题7.3 (C语言代码)浏览:640 |
WU-字符串比较 (C++代码)浏览:793 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:482 |
简单的a+b (C语言代码)浏览:603 |
1051(奇了怪了)浏览:702 |