解题思路:
注意事项:
参考代码:
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语言训练-亲密数 (C++代码)浏览:733 |
字符串的输入输出处理 (C语言代码)浏览:655 |
2005年春浙江省计算机等级考试二级C 编程题(3),复杂度最低的方法没有之一!!!!!浏览:805 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:578 |
C语言程序设计教程(第三版)课后习题8.8 (C语言代码)浏览:584 |
星期判断机 (C语言代码)浏览:858 |
数字游戏 (C++代码)浏览:1177 |
理财计划 (C语言代码)浏览:465 |
C二级辅导-等差数列 (C语言代码)浏览:770 |
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:446 |