Created
July 3, 2016 12:55
-
-
Save kngwyu/aa5bb5b2b2f6db93f82d52be16785084 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let a = next_line(); | |
let b = getint() - 1; | |
let it = b as usize; | |
let c = a.as_bytes()[it] as char; | |
println!("{}\n", c); | |
} | |
fn next_line() -> String { | |
let mut input = String::new(); | |
std::io::stdin().read_line(&mut input).unwrap(); | |
input | |
} | |
fn getint() -> i32 { | |
let res = next_line(); | |
let res = res.trim().parse().unwrap(); | |
res | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment