Hangzhou Electric 1108--Least common multiple

Source: Internet
Author: User

Least common multiple

Time limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)
Total submission (s): 39946 Accepted Submission (s): 22340


Problem description given two positive integers, calculate the least common multiple of these two numbers.

Input inputs contain multiple sets of test data, with only one row per group, including two positive integers not greater than 1000.

Output for each test case, give the least common multiple of these two numbers, and each instance outputs a row.

Sample Input
Ten  -

Sample Output
70

Sourcepoj

Recommendeddy | We have carefully selected several similar problems for you:1061 1005 1071 1019 1425
1#include <stdio.h>2 3 intGCD (intAintb)4 {5     intI, t, temp;6      for(i=1; i<=a; i++)7     {8         if(a%i = =0&& b%i = =0)9temp =i; Ten     }  One     returna*b/temp; A } -  - intMain () the { -     intA, B; -      while(~SCANF ("%d%d", &a, &b)) -     { +         inttemp =gcd (A, b); -printf"%d\n", temp);  +     }  A     return 0 ; at}

Hangzhou Electric 1108--Least common multiple

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.