Fundamentals34 / 42
Up next

Read and parse a number

use std::io;

fn main() {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    let n: i32 = s.trim().parse().expect("not a number");
    println!("{}", n * 2);
}
What you're solving

trim then parse the input