303672: CF710A. King Moves
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
King Moves
题意翻译
这里只有一个国王在国际象棋的棋盘上。 你会知道这个国王的坐标 $cd$ :其中 $c$ 是行,用字母 $a$ 到 $h$ 表示, $d$ 是列,用数字 $1$ 到 $8$ 表示。 现在,你需要求的是,这个国王可以移动到几个格子上。 例如:![](https://cdn.luogu.org/upload/vjudge_pic/CF710A/c293477e407dd29c222477fd35652e45e6890a3c.png) 图片中的国王位于 $e4$ ,他可以移动到 $8$ 个位置。 Translated by @dblark题目描述
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>. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF710A/c293477e407dd29c222477fd35652e45e6890a3c.png)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