Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
HackerEarth Input for Rust
use std::io;
fn main() {
let mut input = String::new();
io::stdin().read_line(&mut input)
.expect("Failed to read line.");
let test_cases: u16 = input
.trim() // trim new line char
.parse()
.expect("Failed to parse unsigned int.");
println!("test_cases: {}", test_cases);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.