codeforces 710A King Moves(水)
standard output
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).
King moves from the position 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'.
Print the only integer x — the number of moves permitted for the king.
e4
8
分析:给你横纵坐标,瞎搞就好。
#include<bits/stdc++.h>
using namespace std;
int main()
{
char str[];
ios::sync_with_stdio(false);
cin.tie();
cin >> str;
if(str[] == 'a')
{
if(str[] == '' || str[] == '')
cout << << endl;
else
cout << << endl;
}
else if(str[] == 'h')
{
if(str[] == '' || str[] == '')
cout << << endl;
else
cout << << endl;
}
else if(str[] == '' || str[] == '')
{
cout << << endl;
}
else
cout << << endl;
return ;
}
codeforces 710A King Moves(水)的更多相关文章
- CodeForces 710A King Moves (水题)
题意:给定一个坐标,问你皇后有几个方向可以走. 析:直接格举那八个方向即可. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000 ...
- CodeForces 710A King Moves(水题-越界问题)
题目链接:http://codeforces.com/problemset/problem/710/A 题目大意:在一个棋盘中给出一个位置,判断该位置周围8个点还有几个点可以摆放棋子. AC代码解释解 ...
- 【模拟】Codeforces 710A King Moves
题目链接: http://codeforces.com/problemset/problem/710/A 题目大意: 国际象棋标准8X8棋盘,国王能往周围8个方向走.输入国王的位置,输出当前国王能往几 ...
- CodeForces 710A King Moves
简单题. #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #inclu ...
- codeforces 710A A. King Moves(水题)
题目链接: A. King Moves 题意: 给出king的位置,问有几个可移动的位置; 思路: 水题,没有思路; AC代码: #include <iostream> #include ...
- [Educational Codeforces Round 16]A. King Moves
[Educational Codeforces Round 16]A. King Moves 试题描述 The only king stands on the standard chess board ...
- CodeForces.158A Next Round (水模拟)
CodeForces.158A Next Round (水模拟) 题意分析 校赛水题的英文版,坑点就是要求为正数. 代码总览 #include <iostream> #include &l ...
- Codeforces Gym 100531G Grave 水题
Problem G. Grave 题目连接: http://codeforces.com/gym/100531/attachments Description Gerard develops a Ha ...
- Codeforces 1089K - King Kog's Reception - [线段树][2018-2019 ICPC, NEERC, Northern Eurasia Finals Problem K]
题目链接:https://codeforces.com/contest/1089/problem/K time limit per test: 2 seconds memory limit per t ...
随机推荐
- Linux常用软件tree,autojump,lrzsz安装
tree安装 1.获取压缩文件 wget http://mama.indstate.edu/users/ice/tree/src/tree-1.7.0.tgz 2.解压缩 tar -zxvf tree ...
- HDU 4704 Sum Fermat定律
Problem Description Sample Input 2 Sample Output 2 Hint 1. For N = 2, S(1) = S(2) = 1. 2. The in ...
- MySQ学习笔记之十 NULL值处理
这是MySQL一大特殊之处. 概念上.NULL意味着"没有值"或"未知值",且它被看作有点与众不同的值. 为了測试NULL.你不能使用算术比較运算符比如=.&l ...
- bzoj1009: [HNOI2008]GT考试(kmp+矩阵乘法)
1009: [HNOI2008]GT考试 题目:传送门 题解: 看这第一眼是不是瞬间想起组合数学??? 没错...这样想你就GG了! 其实这是一道稍有隐藏的矩阵乘法,好题! 首先我们可以简化一下题意: ...
- hdoj--1301--Jungle Roads(克鲁斯卡尔)
Jungle Roads Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tot ...
- python 同步IO
IO在计算机中指Input/Output 由CPU这个超快的计算核心来执行,涉及到数据交换的地方,通常是磁盘.网络等,就需要IO接口.IO编程中,Stream(流)是一个很重要的概念,可以把流想象成一 ...
- The evolution of cluster scheduler architectures--转
原文地址:http://www.firmament.io/blog/scheduler-architectures.html cluster schedulers are an important c ...
- RSA加密的方式和解密方式
RSAsecurity.java package com.mstf.rsa; import java.security.KeyFactory; import java.security.KeyPair ...
- C#共享WIFI能通过代码控制给连接的移动端分配IP么
用C#创建了一个虚拟WIFI,但是能不能通过代码来给连接上的移动端分配各自的IP.之前都是自动分配的IP.望大神们赐教 C#共享WIFI能通过代码控制给连接的移动端分配IP么 >> csh ...
- MPP的进化 - 深入理解Batch和MPP优缺点
https://mp.weixin.qq.com/s/scXNfkpjktCZxBg3pYEUUA?utm_medium=hao.caibaojian.com&utm_source=hao.c ...