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

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.|
+---+---+---+---+---+---+---+---+
还是模拟题
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std; const int Max=1100000; char str[]="+---+---+---+---+---+---+---+---+";
char s1[]="|:::|...|:::|...|:::|...|:::|...|";
char s2[]="|...|:::|...|:::|...|:::|...|:::|";
char Map[55][55];
void Trans(char s[])
{
bool flag=false;
if(s[0]=='B')
{
flag=true;
}
for(int i=7; s[i];)
{
if(s[i]>='A'&&s[i]<='Z')
{
int u=s[i+1]-'a'+1;
int v=s[i+2]-'0';
if(flag)
{
Map[v][u]=s[i]+32;
}
else
{
Map[v][u]=s[i];
}
i+=4;
}
else if(s[i]>='a'&&s[i]<='z')
{
int u=s[i]-'a'+1;
int v=s[i+1]-'0';
if(flag)
{
Map[v][u]='p';
}
else
{
Map[v][u]='P';
}
i+=3;
}
}
}
int main()
{
char white[110];
char black[110];
memset(white,'\0',sizeof(white));
memset(black,'\0',sizeof(black));
gets(white);
gets(black);
memset(Map,0,sizeof(Map));
Trans(white);
Trans(black);
int u=8;
for(int i=17; i>=1; i--)
{
if(i%2)
{
printf("%s\n",str);
}
else
{
int ans=2;
int v=1;
if((i/2)%2)
{
for(int j=0; j<33; j++)
{
if(j!=ans)
{
printf("%c",s1[j]);
}
else
{
if(Map[u][v])
{
printf("%c",Map[u][v]);
}
else
{
printf("%c",s1[j]);
}
v++;
ans+=4;
}
}
}
else
{
for(int j=0; j<33; j++)
{
if(j!=ans)
{
printf("%c",s2[j]);
}
else
{
if(Map[u][v])
{
printf("%c",Map[u][v]);
}
else
{
printf("%c",s2[j]);
}
v++;
ans+=4;
}
}
}
printf("\n");
u--;
}
}
return 0;
}

版权声明:本文为博主原创文章,未经博主允许不得转载。

Emag eht htiw Em Pleh 分类: POJ 2015-06-29 18:54 10人阅读 评论(0) 收藏的更多相关文章

  1. Tautology 分类: POJ 2015-06-28 18:40 10人阅读 评论(0) 收藏

    Tautology Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 10428   Accepted: 3959 Descri ...

  2. Number Sequence 分类: HDU 2015-06-19 20:54 10人阅读 评论(0) 收藏

    Number Sequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tot ...

  3. Ubuntu vim+ ctags(包含系统函数) + taglist 配置 分类: vim ubuntu 2015-06-09 18:19 195人阅读 评论(0) 收藏

    阅读大型代码,我们经常需要打开很多的代码文件,搜索各种定义.windows下用惯了ide的朋友,转战Linux的时候可能会觉得很难受,找不到合适的阅读工具.其实万能的vim就可以实现.下面介绍一下vi ...

  4. OpenCV与QT联合编译 分类: Eye_Detection ZedBoard OpenCV shell ubuntu 2014-11-08 18:54 143人阅读 评论(0) 收藏

    问题1:首先参考rainysky的博客,发现qmake时发生找不到目录,文件的错误,又找不到 qmake.conf 文件的写法.所以开始按照网上的程序修改 XXX.pro 文件. 问题2:使用QT C ...

  5. Rebuild my Ubuntu 分类: ubuntu shell 2014-11-08 18:23 193人阅读 评论(0) 收藏

    全盘格式化,重装了Ubuntu和Windows,记录一下重新配置Ubuntu过程. //build-essential sudo apt-get install build-essential sud ...

  6. 由 argv引出的main参数 分类: C/C++ 2014-11-08 18:00 154人阅读 评论(0) 收藏

    我们经常用的main函数都是不带参数的.因此main 后的括号都是空括号.实际上,main函数可以带参数,这个参数可以认为是 main函数的形式参数.C语言规定main函数的参数只能有两个, 习惯上这 ...

  7. Monthly Expense(二分) 分类: 二分查找 2015-06-06 00:31 10人阅读 评论(0) 收藏

    Description Farmer John is an astounding accounting wizard and has realized he might run out of mone ...

  8. [leetcode] Reverse Linked List 分类: leetcode 算法 2015-07-09 18:44 2人阅读 评论(0) 收藏

    反转链表:比较简单的问题,可以遍历也可以递归. # Definition for singly-linked list. class ListNode: def __init__(self, x): ...

  9. Win10尝鲜体验——初识传说中不一样的Windows 分类: 资源分享 2015-07-24 18:27 13人阅读 评论(0) 收藏

    这几天,网上传来一个消息,虽然不知是好是坏,Win10可以下载安装了! 出于好奇,下载尝鲜,几个截图,留作纪念~ 中文,还是要好好支持的,毕竟中国有如此多的用户 可选的安装版本 许可条款也刚刚出炉,估 ...

随机推荐

  1. PAT 解题报告 1048. Find Coins (25)

    1048. Find Coins (25) Eva loves to collect coins from all over the universe, including some other pl ...

  2. 《30天自制操作系统》08_day_学习笔记

    harib05a: 鼠标解读(01)P145 前一天已经让鼠标成功接收数据了,这些数据是什么意思? 笔者在这一部分来解读数据:让鼠标动起来啊,停在那不动有什么意思啊! 前面已经知道,鼠标每一次动作都是 ...

  3. hdu 4998

    http://acm.hdu.edu.cn/showproblem.php?pid=4998 这道题,在比赛的时候看了很久,才明白题目的大意.都怪自己不好好学习英语.后来经过队友翻译才懂是什么意思. ...

  4. ubuntu安装jdk遇到的问题:cannot execute binary file

    安装完jdk,配置好环境变量出现如下状况: cannot execute binary file 问题原因: jdk的位数与ubuntu的系统位数不一致 jdk 64位 ubuntu 32位 然后通过 ...

  5. 夺命雷公狗ThinkPHP项目之----企业网站23之网站前台二级分类的跳转(URL跳转到列表页或产品页)

    我们现在开始做实现我们的二级菜单如何跳转到指定的列表页或者产品也呢?? 我们分享下数据库情况: 我们的数据库里提前给我们预留了一个cate_type的字段,那么我们可以让这个字段进行判断,从而遍历出指 ...

  6. zw版【转发·台湾nvp系列Delphi例程】HALCON EdgesImage

    zw版[转发·台湾nvp系列Delphi例程]HALCON EdgesImage procedure TForm1.Button1Click(Sender: TObject);var img0, im ...

  7. Python for z/OS

    Install pythondev Install DB2 or server driver package easy_install ibm_db Get license file from tor ...

  8. EL表达式,JSTL:jsp standard Tag Library

    1.EL表达式的作用: 1.1访问Bean的属性.  方式一:${对象名 . 属性名} eg:${user.name}    方式二:${对象名["属性名"]} 1.2输出简单的运 ...

  9. 模块已加载,但对dllregisterServer的调用失败

    在注册dll或者ocx的时候, 经常会遇到这么一个问题: 模块  已加载,但对dllregisterServer的调用失败,错误代码为0x8004***** 网上有网友回复说需要在管理员的模式下进行注 ...

  10. android 之 Crash信息的持久化处理

    需求: 持久化运行时异常的信息 1.CrashHandler.java import android.content.Context; import android.content.pm.Packag ...