aoc

My solutions for the Advent of Code
git clone https://git.tronto.net/aoc
Download | Log | Files | Refs | README

a.rs (298B)


      1 mod common;
      2 use common::*;
      3 
      4 fn main() {
      5     let mut line = String::new();
      6     let mut sum = Snafu::zero();
      7     while std::io::stdin().read_line(&mut line).unwrap() > 0 {
      8         let s = Snafu::from_str(&line[..line.len()-1]);
      9         sum += &s;
     10         line.clear();
     11     }
     12     println!("{sum}");
     13 }