use std::io::{self, Read};
fn main() {
let mut input = String::new();
io::stdin().read_to_string(&mut input).unwrap();
let mut it = input.split_whitespace();
let x: i32 = it.next().unwrap().parse().unwrap();
let d: i32 = it.next().unwrap().parse().unwrap();
let h: i32 = it.next().unwrap().parse().unwrap();
let m: i32 = it.next().unwrap().parse().unwrap();
let ldor;
if x <= 4 {
ldor = 23 + x;
} else {
ldor = 24 + x;
}
let mut result = (ldor - d)*24*60 + (23-h) * 60 + (60-m);
if x == 5 && !(d == 29 && h > 2) {
result -= 60;
}
print!("{}", result);
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | use std::io::{self, Read}; fn main() { let mut input = String::new(); io::stdin().read_to_string(&mut input).unwrap(); let mut it = input.split_whitespace(); let x: i32 = it.next().unwrap().parse().unwrap(); let d: i32 = it.next().unwrap().parse().unwrap(); let h: i32 = it.next().unwrap().parse().unwrap(); let m: i32 = it.next().unwrap().parse().unwrap(); let ldor; if x <= 4 { ldor = 23 + x; } else { ldor = 24 + x; } let mut result = (ldor - d)*24*60 + (23-h) * 60 + (60-m); if x == 5 && !(d == 29 && h > 2) { result -= 60; } print!("{}", result); } |
English