hdu 1108 最小公倍数(水题)
来源:互联网 发布:网络歌曲梅花泪文希 编辑:程序博客网 时间:2024/05/23 17:34
思路:辗转相除法
代码:
#include <iostream>#include <stdio.h>#include <string.h>#include <math.h>#include <stdlib.h>#include <map>#include <set>#include <vector>#include <algorithm>using namespace std;#define mst(a,b) memset(a,b,sizeof(a))#define eps 10e-8const int MAX_ = 10010;int gcd(int a,int b){ return b?gcd(b,a%b):a;}int lcm(int a,int b){ return a/gcd(a,b)*b;}int main(){ int a, b;while(~scanf("%d%d",&a,&b)){ printf("%d\n",lcm(a,b));}return 0;}
0 0
- hdu 1108 最小公倍数(水题)
- hdu 1108 最小公倍数(最大公约数、最小公倍数)
- hdu 1108 最小公倍数 (GCD)
- HDU 1108 最小公倍数(水~)
- HDU 1108 最小公倍数(stein算法)
- HDU 1108 最小公倍数(Gcd 数论)
- hdu 1108 最小公倍数
- HDU 1108 最小公倍数
- HDU 1108 最小公倍数
- HDU 1108 最小公倍数
- hdu-1108 最小公倍数
- hdu 1108 最小公倍数
- HDU 1108 最小公倍数
- hdu 1108 最小公倍数
- hdu-1108-最小公倍数
- HDU 1108 最小公倍数
- hdu/hdoj 1108 最小公倍数
- hdu 1108 最小公倍数
- 介绍sqlmap使用的地方
- iOS开发过程中需要注意的问题
- DES加密,ECB和CBC区别
- CDH hive的mr架构配置文件的选择
- IOS 7 Xcode 5 免IDP证书 真机调试
- hdu 1108 最小公倍数(水题)
- CAP理论
- hadoop学习笔记之maven、mahout
- sd驱动uboot
- 浅谈android的跑马灯效果(文字滚动)
- VC实现简单杀软
- 微博开发设计方案节选
- Struts,Hibernate,Spring经典面试题
- C++解剖-> ||与&& 运算符认识