/*

最小公倍数

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)

Total Submission(s): 32933    Accepted Submission(s): 18398

Problem Description

给定两个正整数,计算这两个数的最小公倍数。

Input

输入包括多组測试数据,每组仅仅有一行,包括两个不大于1000的正整数.

 

Output

对于每一个測试用例,给出这两个数的最小公倍数,每一个实例输出一行。

Sample Input

10 14

Sample Output

70

*/

#include<stdio.h>         //递归思想

int swap(int a,int b)

{

 if(a>b)

 {

  return !b?

a:swap(b,a%b);

 }

 else if(a<b)

 {

  return !a?b:swap(a,b%a);

 }

 else return a;

}

int main()

{

 int a,b;

 while(~scanf("%d %d",&a,&b))

 {

  printf("%d\n",a*b/swap(a,b));

 }

 return 0;

}

最新文章

  1. Image模块
  2. CentOS6上无法启动NFS服务
  3. Windows Azure Virtual Machine (31) 迁移Azure虚拟机
  4. Overlay network 覆盖网络
  5. Redis基础知识之—— 5个必须了解的事情【★★★★★】
  6. CodeColorer支持的语言
  7. Why are very few schools involved in deep learning research? Why are they still hooked on to Bayesian methods?
  8. 【原创】Java移位运算
  9. 20151217jquery学习笔记--注册表单
  10. Vim及VimScript资料总结《转载》
  11. 学习javascript基础知识系列第三节 - ()()用法
  12. hosts文件导致无法访问网站
  13. python3.x中如何实现print不换行
  14. Images as x-axis labels
  15. java集合相关问题
  16. HASHSET不能预留容量问题
  17. 【原创】深入理解c++的右值引用
  18. Ubuntu 12.04上安装Hadoop并运行
  19. grid - 网格轨道最小和最大尺寸
  20. 【做题】apc001_f-XOR Tree——巧妙转化及dp

热门文章

  1. ElasticSearch Mapping中的字段类型
  2. Java中的对象池技术
  3. hdu 5592 ZYB&#39;s Premutation (权值线段树)
  4. BZOJ 2733 [HNOI2012]永无乡(启发式合并+Treap+并查集)
  5. [NOIp2016提高组]愤怒的小鸟
  6. 将json字符串转换成list&lt;T&gt;
  7. Codeforces Round #344 (Div. 2) D. Messenger kmp
  8. Android Logcat Security(转)
  9. 如何ping测有端口的网站
  10. countdownlatch用法