题目: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. phpcmsv9全站搜索,不限模型

    简单修改一下v9默认的搜索功能,可以不按模型搜索全站内容 下面是被修改后的search模块中的index.php文件 <?php defined('IN_PHPCMS') or exit('No ...

  2. Spark Streaming揭秘 Day24 Transformation和action图解

    Spark Streaming揭秘 Day24 Transformation和action图解 今天我们进入SparkStreaming的数据处理,谈一下两个重要的操作Transfromation和a ...

  3. python 判断 windows 隐藏文件/系统文件

    linux 下隐藏文件是以句号 “.” 开头的文件,根据文件名即可判断是否为隐藏文件. win 下是以文件隐藏属性确定的,所以,只能通过微软的 API 获取隐藏属性来判断是否为隐藏文件. 1. win ...

  4. javascript insertBefore 和 appendChild

    js的appendChild()方法 :在一个元素内部追加一个子节点. js的insertBefore()方法:在一个元素内部指定的子节点之前插入子节点. 很明显,appendChild()方法只需要 ...

  5. Hello World for U (20)

    Given any string of N (>=5) characters, you are asked to form the characters into the shape of U. ...

  6. dom树的介绍,及原理分析

    三.解析和DOM树的构建 1.解析: 由于解析渲染引擎是一个非常重要的过程,我们将会一步步的深入,现在让我们来介绍解析. 解析一个文档,意味着把它转换为一个有意义的结构——代码可以了解和使用的东西,解 ...

  7. 转载 @html.ActionLink的几种参数格式

    一 Html.ActionLink("linkText","actionName") 该重载的第一个参数是该链接要显示的文字,第二个参数是对应的控制器的方法, ...

  8. html input type="button" 页面跳转

    <div class="message_text"> <p>你的申请已提交,请耐心等候哦!~</p><br /> <input ...

  9. Nhibernate 多对多级联更新

    问题是这样的,有两个表:文章(Article)和分类(Lable),这两者之间的关系是多对多关联,如果你用Nhibernate来保存数据的话非常的好操作,新建Article,然后把Lable值赋值给A ...

  10. 解决Maven不能下载“oracle、aspectjweaver、com.springsource.net.sf.cglib”jar

    鸣谢网址:http://www.cnblogs.com/dongyangbolg/p/3455422.html http://www.cnblogs.com/ysq0908/p/4737977.htm ...