use std::fs::File; use std::io::prelude::*; use std::io::BufReader; fn main() { let file = File::open("input.txt").expect("File not found"); let reader = BufReader::new(file); let values: Vec = reader .lines() .map(|x| x.unwrap().parse::().unwrap()) .collect::>(); let mut increasing: u16 = 0; for index in 1..values.len() { if values[index - 1] < values[index] { increasing += 1; } } println!("{}", increasing); }