Last active
September 8, 2020 07:29
-
-
Save kinoshita-lab/36eff2371fb1d8f4857a4d1e5750050a to your computer and use it in GitHub Desktop.
project euler problem 5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Yutani-san(@yutannihilation) adviced me much simpler implementation. Thanks!! | |
fn main() { | |
let upper = 20; | |
let mut i = 0; | |
loop { | |
i += 1; | |
if !(2..upper).any(|j| i % j != 0) { | |
println!("{:?}", i); | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment