fn main() { let month_day_max = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; let mut counter = 0; for i in 1..13 { let mut day = (0, i); for _ in 0..i+1 { if (day.0 * 10 + day.1) <= month_day_max[i - 1] { counter += 1; } } } println!("{}", counter); }