CF710A.King Moves
入门
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
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 https://en.wikipedia.org/wiki/King_(chess).
King moves from the position e4
唯一的国王站在标准国际象棋棋盘上。你将获得其位置,格式为“cd”,其中 c 是从 'a' 到 'h' 的列,d 是从 '1' 到 '8' 的行。求该国王允许走的步数。
国王的走法参见 https://en.wikipedia.org/wiki/King_(chess)。
国王从 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'.
唯一的一行包含国王的位置,格式为“cd”,其中‘c’是列,取值范围为‘a’到‘h’,‘d’是行,取值范围为‘1’到‘8’。
输出格式
Print the only integer x — the number of moves permitted for the king.
输出唯一的整数 x —— 国王被允许的移动步数。
输入输出样例
输入#1
e4
输出#1
8
输入解题思路,AI测评打分。不知道怎么写?