Submission #1589192
Source Code Expand
fn main() { let x: char = read(); println!("{}", x as u32 - 'A' as u32 + 1); } fn read() -> char { let mut buf = String::new(); std::io::stdin().read_line(&mut buf).ok(); buf.trim().parse().ok().unwrap() }
Submission Info
Compile Error
error[E0277]: the trait bound `char: std::str::FromStr` is not satisfied --> ./Main.rs:9:14 | 9 | buf.trim().parse().ok().unwrap() | ^^^^^ the trait `std::str::FromStr` is not implemented for `char` error: aborting due to previous error