A10491. King Moves
编程题
普及/提高-
知识点
题目描述
The only king stands on the standard chess board. You are given his position in format "cd", where $c$ is the column from 'a' to 'h' and $d$ is the row from '1' to '8'. Find the number of moves permitted for the king.
Check the king's moves here <a>https://en.wikipedia.org/wiki/King\_(chess)</a>.
King moves from the position e4
Check the king's moves here <a>https://en.wikipedia.org/wiki/King\_(chess)</a>.
King moves from the position e4
输入格式
The only line contains the king's position in the format "cd", where 'c' is the column from 'a' to 'h' and 'd' is the row from '1' to '8'.
输出格式
Print the only integer $x$ — the number of moves permitted for the king.
输入输出样例
输入 #1
e4
输出 #1
8