-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlvl1.rs
39 lines (33 loc) · 1.26 KB
/
lvl1.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// use std::env;
// use std::fs::File;
// use std::io::{BufRead, BufReader, Write};
// fn main() {
// let args: Vec<String> = env::args().collect();
// let input_file_path = args[1].to_owned();
// let output_file_path = format!("{}.out", input_file_path);
// let input_file = File::open(input_file_path).expect("Error opening input file");
// let reader = BufReader::new(input_file);
// // skip the first two line
// let mut reader = reader.lines();
// reader.next();
// reader.next();
// let mut coins = Vec::new();
// let mut output_file =
// File::create(output_file_path.clone()).expect("Error creating output file");
// // loop over other lines
// for line in reader {
// let line = line.expect("Error reading line");
// coins.clear();
// for coin in line.split_whitespace() {
// // add coin parsed to int to coins vector
// coins.push(coin.parse::<i32>().expect("Error parsing coin"));
// }
// for value in 1..1000 {
// if !coins.contains(&value) {
// writeln!(output_file, "{}", value).expect("Error writing to file");
// break;
// }
// }
// // println!("{:?}", coins);
// }
// }