Cleanup
This commit is contained in:
parent
cbaa0a3591
commit
3112a85064
1 changed files with 1 additions and 11 deletions
12
src/main.rs
12
src/main.rs
|
@ -1,23 +1,13 @@
|
|||
use std::env;
|
||||
use std::fs;
|
||||
use std::io::{self, BufRead};
|
||||
use std::collections::BinaryHeap;
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = env::args().collect();
|
||||
let filename = if args.len() > 1 {
|
||||
&args[1]
|
||||
} else {
|
||||
"input.txt"
|
||||
};
|
||||
|
||||
println!("Gonna load {}!", filename);
|
||||
|
||||
let filename = "input.txt";
|
||||
let file = fs::File::open(filename).unwrap();
|
||||
let lines = io::BufReader::new(file).lines();
|
||||
|
||||
let mut heap = BinaryHeap::new();
|
||||
|
||||
let mut cur_cals: u32 = 0;
|
||||
for l in lines {
|
||||
if let Ok(cals) = l.unwrap().parse::<u32>() {
|
||||
|
|
Loading…
Reference in a new issue