use std::io::stdin; use std::io::BufRead; fn main() { let mut prev: Option = None; let mut increased = 0; for line in stdin().lock().lines() { let cur = line.unwrap().parse::().unwrap(); match prev { None => println!("{} (N/A)", cur), Some(prev) => { if cur > prev { increased += 1; } let evaluate = if cur > prev { "increased" } else { "decreased" }; println!("{} ({})", cur, evaluate) } } prev = Some(cur); } println!("{}", increased) }