Skip to content

Instantly share code, notes, and snippets.

@icub3d
Created December 5, 2025 19:43
Show Gist options
  • Select an option

  • Save icub3d/82b10cfa8ac2caa154f2e55c88502a35 to your computer and use it in GitHub Desktop.

Select an option

Save icub3d/82b10cfa8ac2caa154f2e55c88502a35 to your computer and use it in GitHub Desktop.
Kattis oddities
use std::io::{Read, stdin};
fn main() {
let mut s = String::new();
stdin().read_to_string(&mut s).unwrap();
for m in s.lines().skip(1).map(|l| l.parse::<isize>().unwrap()) {
if m % 2 == 0 {
println!("{m} is even");
} else {
println!("{m} is odd");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment