gcd
来源:互联网 发布:新致软件成都分公司 编辑:程序博客网 时间:2024/06/09 19:51
#include<stdio.h>#include<string.h>#include<math.h>int gcd(int x,int y){if(x%y==0)return y;elsereturn gcd(y,x%y);}int main(){ int m,n; while(~scanf("%d%d",&n,&m)) { printf("%d\n",(n*m)/gcd(n,m)); }}//求最小公倍数 如果要求最大公约数 把n*m去掉即可
阅读全文
0 0
- gcd
- GCD
- GCD
- GCD
- GCD
- GCD
- GCD
- GCD
- GCD
- GCD
- GCD
- GCD
- gcd
- GCD
- GCD
- GCD
- GCD
- GCD
- Hibernate的一级缓存
- POJ 1009--Edge Detection
- 文件批量上传--smartUpload
- bzoj2748: [HAOI2012]音量调节
- HAUTOJ 1265 Hmz 的女装
- gcd
- 牛客剑指offer刷题记录(四)
- http协议
- 二叉搜索树的后续遍历
- Python空间数据处理3: HDF格式转GDAL支持格式
- Python3.x执行POST请求是出现POST data should be bytes or an iterable of bytes. It cannot be of type str.错误
- Android系列之自定义Button控件
- Hibernate绑定session
- Java两种实现多线程方式的比较( implements Runnable 与 extends Thread )