Project Euler #5(Smallest positive number divisible by all numbers from 1 to 20): Ways to Optimize? ~Java
问题 Problem 5: 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? I have solved the problem 5 of Project Euler Here is the Java code: static long FindLcm(long a,long b) { long lcm,hcf = 0; long i=1; long ger=a>b?a:b; while(i<ger) { if((a%i==0) && (b%i==0)) hcf=i; i++; } lcm=(a*b)/hcf; return lcm; } static void FindMultiple() { long lcm=1; for