Browse Source

002-ok + readme

master
Coin de Gamma 2 years ago
parent
commit
f27ed132e9
  1. 17
      002/solution.rs
  2. 6
      README.md

17
002/solution.rs

@ -0,0 +1,17 @@
fn main() {
let mut a1 = 1;
let mut a2 = 2;
let mut sum = 0;
while a2 <= 4_000_000 {
if a2 % 2 == 0 {
sum += a2;
}
let a_new = a1 + a2;
a1 = a2;
a2 = a_new;
// println!("{}", a_new);
}
println!("{}", sum);
}

6
README.md

@ -5,3 +5,9 @@ no to actually solve all problems
https://projecteuler.net
## run soultion
```bash
cd 001
rustc solution.rs && solution
```

Loading…
Cancel
Save