Day 1
This commit is contained in:
parent
368a2edb3c
commit
0c7a00d4fb
2 changed files with 1007 additions and 0 deletions
13
2018/src/main.rs
Normal file
13
2018/src/main.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
use std::str;
|
||||
|
||||
fn main() {
|
||||
let input = include_str!("day1-input.txt");
|
||||
let mut freq = 0;
|
||||
for line in str::lines(input) {
|
||||
match line.parse::<i32>() {
|
||||
Ok(d) => freq += d,
|
||||
Err(s) => println!("{}", s),
|
||||
}
|
||||
}
|
||||
println!("{}", freq);
|
||||
}
|
||||
Loading…
Reference in a new issue