题目:http://poj.org/problem?id=2993

题意:和2996反着

 #include <iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
using namespace std; struct node
{
int x,y;
char ch;
}q[];
bool cmp(node a,node b)
{
if(a.x!=b.x) return a.x>b.x;
return a.y<b.y;
} int main()
{
int sum=,i,j,t=;
char c,a,b,d; scanf("White:");
while(scanf("%c",&c)&&c!='\n')
{
cin>>a>>b;
if(b>='a'&&b<='z')
{
cin>>d;
q[sum].ch=a; q[sum].x=d-; q[sum++].y=b-;
}
else
{
q[sum].ch='P'; q[sum].x=b-; q[sum++].y=a-;
}
}
scanf("Black:");
while(scanf("%c",&c)&&c!='\n')
{
cin>>a>>b;
if(b>='a'&&b<='z')
{
cin>>d;
q[sum].ch=a+; q[sum].x=d-; q[sum++].y=b-;
}
else
{
q[sum].ch='p'; q[sum].x=b-; q[sum++].y=a-;
}
}
sort(q,q+sum,cmp);
for(i=; i>=; i--)
{
printf("+---+---+---+---+---+---+---+---+\n");
for(j=; j<; j++)
{
if((i+j)%==) a='.';
else a=':';
if(q[t].x==i&&q[t].y==j&&t<sum)
{printf("|%c%c%c",a,q[t].ch,a); t++;}
else
printf("|%c%c%c",a,a,a);
}
cout<<"|"<<endl;
}
printf("+---+---+---+---+---+---+---+---+\n");
return ;
}

poj 2993 Emag eht htiw Em Pleh(模拟)的更多相关文章

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

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

  2. 模拟 POJ 2993 Emag eht htiw Em Pleh

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

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

  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. POJ 2993:Emag eht htiw Em Pleh

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

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

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

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

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

  9. Emag eht htiw Em Pleh(imitate)

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

随机推荐

  1. 在windows服务器中,将MongoDB服务化。

    将mongodb在windows中服务化,就是将其注册成一个服务组件,并可以设置成,手动/自动 启动. 一般的我们都会在command窗口运行如下: d:\mongodb\bin>mongod ...

  2. MIT 2012 分布式课程基础源码解析-底层通讯实现

    本节内容和前节事件管理封装是息息相关的,本节内容主要包含的代码在connection{.h, .cc}中. 这里面最主要的有两个类:connection类和tcpsconn类,connetion类主要 ...

  3. python安装与环境变量配置

    默认情况下,在windows下安装python之后,系统并不会自动添加相应的环境变量.此时不能在命令行直接使用python命令. 1. 首先需要在系统中注册python环境变量:假设python的安装 ...

  4. ios NavBar+TarBar技巧

    NavBar+TarBar iphone开发 NavBar+TarBar 1  改变NavBar颜色:选中Navigation Bar 的Tint属性.选中颜色. 2  隐藏“back”按钮: sel ...

  5. how to get sharepoint lookup value

    SPFieldLookup lookUp1 = properties.ListItem.ParentList.Fields.GetField("Leave_x0020_Type") ...

  6. vs中使用过的扩展和好的nuget库

    扩展 ReAttach ReAttach gives you an easy way to ReAttaching your prior debug targets. ReAttach stores ...

  7. bnuoj 1071 拼图++(BFS+康拓展开)

    http://www.bnuoj.com/bnuoj/problem_show.php?pid=1071 [题意]:经过四个点的顺逆时针旋转,得到最终拼图 [题解]:康拓展开+BFS,注意先预处理,得 ...

  8. mybatis--面向接口编程

    如果使用hiberante作为dao层,常用的方式是:定义一个dao层接口包(com.dao.service)然后在定义一个dao层接口实现包(com.dao.service.impl),这样定义结构 ...

  9. sql之left join、right join、inner join的区别(转)

    感谢:http://www.cnblogs.com/pcjim/articles/799302.html ----------------------------------------------- ...

  10. obj转换成数组

    原则上obj是不能转换成数组的.首先array也是obj.只是一个特殊的object. obj一个很关键的点,是拥有成员和方法,撇开方法不说,obj就是一个key-value结构.也就是哈希数组,而j ...