Description
he 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).
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
#include<bits/stdc++.h>
using
namespace
std;
int
main()
{
string s;
cin>>s;
if
(s[0]==
'a'
&&s[1]==
'8'
)
cout<<
"3"
<<endl;
return
0;
}
else
'h'
'1'
&&(s[1]>=
&&s[1]<=
'7'
))
"5"
((s[0]>=
'b'
&&s[0]<=
'g'
)&&(s[1]==
"8"
🍺
没有50年的脑血栓,想不出来在C盘缓存这玩意的,微软的这帮人脑子里都装的啥
楼主还在吗,为啥我能运行,右边不显示识别结果和车牌定位
博主,你论文就是写了这些吗,我和你的差不多,交初稿上去后导师说这系统太简单了,工作量不够
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
· 三行代码完成国际化适配,妙~啊~