주어진 문자열에서 n번째 알파벳을 출력하라.
Bash
bash
read str
read n
echo "${str:$n-1:1}"
1
2
3
2
3
Node.js
javascript
const [str, n] = require("fs").readFileSync(0).toString().trim().split("\n");
console.log( str[n*1-1] );
1
2
2
Python3
python
text = input()
n = int(input())
print( text[n-1] )
1
2
3
2
3
Ruby
ruby
str = gets.chomp
n = gets.chomp.to_i
puts str[n-1]
1
2
3
2
3
Comments
Not supported comment edit and upvote
You can do it on this page if you want.