posts - 99,  comments - 8,  trackbacks - 0
#include <stdio.h>
#include <stdlib.h>

int gcd (int big, int small)
{
    if (small==0)
       return big;
       else
       {
           gcd (small, big%small);
       }
}
int main ()
{
    int big, small, temp;
    
    while ( scanf ("%d%d", &big, &small) != EOF )
    {
          if (big < small)
          {
                  temp = big;
                  big = small;
                  small = temp;
          }
          int b = big;
          int s = small;
          int result = gcd (big, small);
          printf ("%d\n", (b*s) / result);
    } 
    system("pause");
    
    return 0;
}
posted on 2010-08-28 21:58 雪黛依梦 阅读(372) 评论(0)  编辑 收藏 引用 所属分类: 数论
<2025年5月>
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

常用链接

留言簿(4)

随笔分类

随笔档案

文章档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜