Add template + setup script to get started quickly

This commit is contained in:
2024-02-11 12:46:21 +01:00
parent 387355f690
commit 68fa7fa6f5
3 changed files with 41 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
fn main() {
// Use command line arguments to specify the input filename.
let args: Vec<String> = std::env::args().collect();
if args.len() < 2 {
panic!("Usage: ./main <input-file>\nNo input file provided. Exiting.");
}
// Next, read the contents of the input file into a string for easier processing.
let input = std::fs::read_to_string(&args[1]).expect("Error opening file");
// Line-by-line processing is easiest.
let input = input.lines();
// --- TASK BEGIN ---
let mut result = 0;
for line in input {
}
println!("Result: {}", result);
}