Browse Source

source code

pull/1/head
jingxun 3 years ago
parent
commit
f0b300d69b
  1. 15
      day01/src/main.rs

15
day01/src/main.rs

@ -0,0 +1,15 @@
fn main() {
let mut out = vec![1, 1];
let n = 20;
let res;
if n <= 2 {
let idx = n as usize;
res = &out[..idx];
} else {
for i in 0..n - 2 {
out.push(out[i as usize] + out[i + 1 as usize]);
}
res = &out;
}
println!("{:?}",res);
}
Loading…
Cancel
Save