Emag eht htiw Em Pleh
Time Limit: 1000MS   Memory Limit: 65536K
Total Submissions: 2901   Accepted: 1917

Description

This problem is a reverse case of the problem 2996. You are given the output of the problem H and your task is to find the corresponding input.

Input

according to output of problem 2996.

Output

according to input of problem 2996.

Sample Input

White: Ke1,Qd1,Ra1,Rh1,Bc1,Bf1,Nb1,a2,c2,d2,f2,g2,h2,a3,e4
Black: Ke8,Qd8,Ra8,Rh8,Bc8,Ng8,Nc6,a7,b7,c7,d7,e7,f7,h7,h6

Sample Output

+---+---+---+---+---+---+---+---+
|.r.|:::|.b.|:q:|.k.|:::|.n.|:r:|
+---+---+---+---+---+---+---+---+
|:p:|.p.|:p:|.p.|:p:|.p.|:::|.p.|
+---+---+---+---+---+---+---+---+
|...|:::|.n.|:::|...|:::|...|:p:|
+---+---+---+---+---+---+---+---+
|:::|...|:::|...|:::|...|:::|...|
+---+---+---+---+---+---+---+---+
|...|:::|...|:::|.P.|:::|...|:::|
+---+---+---+---+---+---+---+---+
|:P:|...|:::|...|:::|...|:::|...|
+---+---+---+---+---+---+---+---+
|.P.|:::|.P.|:P:|...|:P:|.P.|:P:|
+---+---+---+---+---+---+---+---+
|:R:|.N.|:B:|.Q.|:K:|.B.|:::|.R.|
+---+---+---+---+---+---+---+---+

Source

 #include<stdio.h>
#include<string.h>
#include<ctype.h>
char chess[][] ;
char st[] = "+---+---+---+---+---+---+---+---+" ;
char s1[] = "|...|:::|...|:::|...|:::|...|:::|" ,s2[] = "|:::|...|:::|...|:::|...|:::|...|" ;
char color[] ;
char ch ;
int row , col; int main ()
{
// freopen ("a.txt" , "r" , stdin) ;
for (int i = ; i <= ; i++) {
if (i & ) {
strcpy (chess[i] , st) ;
}
else {
if ((i >> ) & )
strcpy (chess[i] , s1) ;
else
strcpy (chess[i] , s2) ;
}
}
gets (color) ;
int len = strlen (color) ;
color [len] = ',' ;
color [len + ] = '\0' ;
color [] = ',' ; for (int i = ; color[i] != '\0' ; i ++) {
int cnt = ;
if (color[i] == ',') {
for (int j = i - ; cnt < ; j-- , cnt++) {
if (cnt == )
row = ( - (color[j] - '') ) * ;
if (cnt == )
col = (color [j] - 'a') * + ;
if (cnt == ) {
if (color[j] == ',')
ch = 'P' ;
else
ch = color[j] ;
}
}
}
chess[row][col] = ch ;
} gets (color) ;
len = strlen (color) ;
color [len] = ',' ;
color [len + ] = '\0' ;
color [] = ',' ; for (int i = ; color[i] != '\0' ; i ++) {
int cnt = ;
if (color[i] == ',') {
for (int j = i - ; cnt < ; j-- , cnt++) {
if (cnt == )
row = ( - (color[j] - '') ) * ;
if (cnt == )
col = (color [j] - 'a') * + ;
if (cnt == ) {
if (color[j] == ',')
ch = 'p' ;
else
ch = tolower (color[j]) ;
}
}
}
chess[row][col] = ch ;
} for (int i = ; i <= ; i++)
puts (chess[i]) ; return ;
}

Emag eht htiw Em Pleh(imitate)的更多相关文章

  1. poj 2993 Emag eht htiw Em Pleh(模拟)

    题目:http://poj.org/problem?id=2993 题意:和2996反着 #include <iostream> #include<cstdio> #inclu ...

  2. 模拟 POJ 2993 Emag eht htiw Em Pleh

    题目地址:http://poj.org/problem?id=2993 /* 题意:与POJ2996完全相反 模拟题 + 字符串处理:无算法,读入两行字符串找出相应点用used标记,输出时标记过的输出 ...

  3. Emag eht htiw Em Pleh 分类: POJ 2015-06-29 18:54 10人阅读 评论(0) 收藏

    Emag eht htiw Em Pleh Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 2937   Accepted: ...

  4. Poj 2993 Emag eht htiw Em Pleh

    1.Link: http://poj.org/problem?id=2993 2.Content: Emag eht htiw Em Pleh Time Limit: 1000MS   Memory ...

  5. POJ2993——Emag eht htiw Em Pleh(字符串处理+排序)

    Emag eht htiw Em Pleh DescriptionThis problem is a reverse case of the problem 2996. You are given t ...

  6. Emag eht htiw Em Pleh

    Emag eht htiw Em Pleh This problem is a reverse case of the problem 2996. You are given the output o ...

  7. 快速切题 poj 2993 Emag eht htiw Em Pleh 模拟 难度:0

    Emag eht htiw Em Pleh Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 2806   Accepted:  ...

  8. POJ 2993 Emag eht htiw Em Pleh【模拟画棋盘】

    链接: http://poj.org/problem?id=2993 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=27454#probl ...

  9. 模拟 + 打表 --- Emag eht htiw Em Pleh

    Emag eht htiw Em Pleh Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 2578   Accepted: ...

随机推荐

  1. 8.HBase In Action 第一章-HBase简介(1.2.2 捕获增量数据)

    Data often trickles in and is added to an existing data store for further usage, such as analytics, ...

  2. iOS开发中的错误整理,通过storyboard做项目,遇到view看不见,或者view被压缩的情况

    前言:在网易新闻的练习中遇到了这个错误 注意:练习中遇到了如图的bug,主要是因为用storyboard布局 600 * 600   显示的时候要经过自动布局,缩小到相应手机的屏幕大小.也就是有的尺寸 ...

  3. Cas_Java客户端登录相关过滤器的处理流程

    首先了解一下CAS登录原理: 1.CAS结构中一般包含CAS服务器(Cas验证服务器).应用服务器(程序所在服务器).客户端(web浏览器)三个部分. 2.客户端向应用服务器发出请求,由于未登录,会被 ...

  4. myeclipse 配置weblogic

    1.打开myeclipse,选择Window -> Preferences--->MyEclipse--->servers 2.点击servers---->weblogic-- ...

  5. Java编程思想学习(四) 访问权限

    几种访问权限修饰词 public,protected,private,friendly(Java中并无该修饰词,即包访问权限,不提供任何访问修饰词) 使用时,放置在类中成员(域或方法)的定义之前的,仅 ...

  6. 【心得&&体会】

    ★2016.1.1★ 很早就想写这样的一篇blog了,但一直没有抽空去实现,新的一年感觉应该有所改变,故深夜提笔(码字) NOIP卡掉和连续两次月考爆炸,这段时间确实心理不舒服,调节的也不是很到位,但 ...

  7. 浅谈Logistic回归及过拟合

    判断学习速率是否合适?每步都下降即可.这篇先不整理吧... 这节学习的是逻辑回归(Logistic Regression),也算进入了比较正统的机器学习算法.啥叫正统呢?我概念里面机器学习算法一般是这 ...

  8. codevs1358 棋盘游戏

    题目描述 Description 这个游戏在一个有10*10个格子的棋盘上进行,初始时棋子位于左上角,终点为右下角,棋盘上每个格子内有一个0到9的数字,每次棋子可以往右方或下方的相邻格子移动,求一条经 ...

  9. Code Review Engine Learning

    相关学习资料 https://www.owasp.org/index.php/Code_review https://www.owasp.org/images/8/8e/OWASP_Code_Revi ...

  10. 取出list的数组元素

    java中将list中的一维数组中的元素取出需要2步.第一步:获取list的迭代器,将数组从迭代器中遍历取出:第二部:对取出的数组进行遍历,取出数组中存储的元素.java的list集合中只能存储引用型 ...