Skip to content

Instantly share code, notes, and snippets.

@kinoshita-lab
Last active September 8, 2020 07:29
Show Gist options
  • Save kinoshita-lab/36eff2371fb1d8f4857a4d1e5750050a to your computer and use it in GitHub Desktop.
Save kinoshita-lab/36eff2371fb1d8f4857a4d1e5750050a to your computer and use it in GitHub Desktop.
project euler problem 5
// 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