[Educational Codeforces Round 16]A. King Moves

[Educational Codeforces Round 16]A. 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 dis 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).

输入

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.

输入示例

e4

输出示例

8

数据规模及约定

题解

分支结构。

 

posted @   xjr01  阅读(179)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示