解题思路:
注意事项:
参考代码:
dic={'a':1,'b':2,'c':3,'d':4,'e':5,'f':6,'g':7,'h':8} n=int(input()) for i in range(n): st=input() s=8 if dic[st[0]]-28: s -= 1 if dic[st[0]]-18: s -= 1 if dic[st[0]]+2>8 or int(st[1])+1>8: s -= 1 if dic[st[0]]+1>8 or int(st[1])+2>8: s -= 1 if dic[st[0]]+1>8 or int(st[1])-28 or int(st[1])-1<=0: s -= 1 if dic[st[0]]-1<=0 or int(st[1])-2<=0: s -= 1 if dic[st[0]]-2<=0 or int(st[1])-1<=0: s -= 1 print(s)
0.0分
0 人评分
【简单计算】 (C语言代码)浏览:622 |
C语言程序设计教程(第三版)课后习题9.8 (C语言代码)浏览:616 |
printf基础练习2 (C语言代码)浏览:748 |
C语言程序设计教程(第三版)课后习题3.7 (C语言代码)浏览:550 |
A+B for Input-Output Practice (IV) (C语言代码)浏览:493 |
字符串比较 (C语言代码)浏览:685 |
格式化数据输出 (C语言代码)浏览:822 |
输入输出格式练习 (C语言代码)浏览:753 |
C语言程序设计教程(第三版)课后习题7.5 (C语言代码)浏览:555 |
幸运数 (C++代码)浏览:2871 |