Emag eht htiw Em Pleh

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
大家可以去poj 看看原题
这提题是逆序输出
 #include<cstdio>
#include<cstring>
#include<iostream>
#include<cstdlib>
using namespace std;
char s[][];
void print(int t)
{
if(t) printf(".");
else printf(":");
}
int main()
{
int xi,yi,i,j,t;
char str[],ch,x,y;
for(i=; i<; i++)
for(j=; j<; j++)
{
if((i+j)%)
s[i][j]='.';
else s[i][j]=':';
}
for(i=; i<; i++)
{
scanf("%s",str);
if(strcmp(str,"White:")==)
{
while(scanf("%c",&ch)&&ch!='\n')
{
if('A'<=ch&&ch<='Z')
{
scanf("%c%c",&x,&y);
xi=x-'a'+;
yi=y-'';
s[yi][xi]=ch;
}
else if('a'<=ch&&ch<'i')
{
xi=ch-'a'+;
scanf("%c",&y);
yi=y-'';
s[yi][xi]='P';
}
}
}
else
{
while(scanf("%c",&ch)&&ch!='\n')
{
if('A'<=ch&&ch<='Z')
{
scanf("%c%c",&x,&y);
xi=x-'a'+;
yi=y-'';
s[yi][xi]=ch+;
}
else if('a'<=ch&&ch<'i')
{
xi=ch-'a'+;
scanf("%c",&y);
yi=y-'';
s[yi][xi]='p';
}
}
}
}
for(i=; i>; i--)
{
printf("+---+---+---+---+---+---+---+---+\n");
for(j=; j<; j++)
{
printf("|");
t=(i+j)%;
print(t);
printf("%c",s[i][j]);
print(t);
}
printf("|\n");
}
printf("+---+---+---+---+---+---+---+---+\n");
return ;
}

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

  1. Emag eht htiw Em Pleh(imitate)

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

  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. 快速切题 poj 2993 Emag eht htiw Em Pleh 模拟 难度:0

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

  7. 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 ...

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

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

  9. POJ 2993:Emag eht htiw Em Pleh

    Emag eht htiw Em Pleh Time Limit: 1000MS   Memory Limit: 65536KB   64bit IO Format: %I64d & %I64 ...

随机推荐

  1. POJ 1737 统计有n个顶点的连通图有多少个 (带标号)

    设f(n)为所求答案 g(n)为n个顶点的非联通图 则f(n) + g(n) = h(n) = 2^(n * (n - 1) / 2) 其中h(n)是n个顶点的联图的个数 这样计算 先考虑1所在的连通 ...

  2. dump_stack的简单使用 +CALL TREE

    http://blog.chinaunix.net/uid-26403844-id-3361770.html http://blog.csdn.net/zifeng274059226/article/ ...

  3. 进程的优先级 与 CFS 进程调度

    在Linux下改变进程的优先级 作者:曾老师,华清远见嵌入式学院讲师. 作为多任务的操作系统,Linux内核为每个创建的进程分配时间片并根据其优先级进行调度.当进程被创建时,其对应的task_stru ...

  4. Navicat Premium 自动备份mysql和sqlserver

    mysql篇: 1.点击计划 2.点击新建处理作业 3.选择需要备份的数据库,上级可用任务 4.点击保存按钮,输入保存文件名 5.保存后点击设置计划任务 6.计划里新建保存时间,应用后输入系统密码即可 ...

  5. ASP生成新会员编号

    Function MakeUserCode OpenDB() Randomize dim getid_rs,getid set getid_rs=rsobj do while true getid=^ ...

  6. app图标和启动页设置

    弄了一下午,终于把iOS中图标的设置和启动页的设置弄明白了.我想以后再也不会浑了. 进入正题: 一:apple 1).iPhone4s 3.5寸屏,也就是640*960,但在模拟器上正常用的是320* ...

  7. (java)从零开始之--异常处理(以文件拷贝为例)

    开发过程中避免不了对异常的处理,但是异常的处理又不能乱throw 下面是简单的抛异常处理 public static void CopyFile(String souFile,String dirFi ...

  8. 115个Java面试题和答案——终极列表

    from http://www.importnew.com/10980.html#collection http://www.importnew.com/11028.html 下面的章节分为上下两篇, ...

  9. CSS负边距自适应布局三例

    单列定宽单列自适应布局: <!DOCTYPE HTML> <html> <head> <meta charset=”UTF-8″> <title& ...

  10. 面试小结(java基础)

    一个.java源文件中可以有多个类吗?(内部类除外)有什么条件?带着这个疑惑,动手建几个测试类, 揭开心中的疑惑.以下是解开疑惑过程: package test;/** * 一个.java源文件中可以 ...