Browse Source

001-ok

master
Coin de Gamma 2 years ago
parent
commit
bd940865c8
  1. 15
      001/solution.rs

15
001/solution.rs

@ -1,5 +1,18 @@
// https://projecteuler.net/problem=1
fn main() {
println!("hello world");
let mut sum = 0;
for n in 1..= 999 {
if n % 3 == 0 {
sum += n;
// println!("-- # {}", n);
}
if n % 5 == 0 && n % 3 != 0 {
// println!("++ # {}", n);
sum += n;
}
}
println!("{}", sum);
}

Loading…
Cancel
Save