use std::env; fn main() { if let Some(input) = env::args().nth(1) { let num: i32 = input.parse().unwrap(); let result = (1..=num).fold(0, |sum, i| i + sum); dbg!(result); } }