POJ 2993Emag eht htiw Em Pleh
http://poj.org/problem?id=2993
这个题与POJ2996正好反着,但个人认为,比2996好做多了,那些边边框框都挺容易输出的,剩下的注意p别忘了给输进去就行,还有白色的是大写,黑色的是小写;
#include<cstdio>
#include<cstring>
#include<iostream>
#include<cstdlib>
#include<algorithm>
using namespace std ;
struct node
{
int row,col;//列
char ch ;
}sh[];
char s1[];
int cnt;
char z,w,x,y,u;
int i,j,k,flag;
int cmp(struct node a,struct node b)
{
if(a.row > b.row)
return ;
else if(a.row == b.row&&a.col < b.col)
return ;
return ;
}
void coutt()
{
cin>>s1;
//scanf("%c",&z);
getchar();
while(scanf("%c",&z)&&z != '\0')
{
if(z < &&z != ',')
{
scanf("%c %c",&y,&x);
cnt++;
sh[cnt].ch = z ;
sh[cnt].col = y- ;
sh[cnt].row = x- ;
}
else if(z != ',')
{
scanf("%c",&w);
cnt++;
sh[cnt].ch = 'P';
sh[cnt].col = z- ;
sh[cnt].row = w- ;
}
}
}
void couttt()
{
cin>>s1;
//scanf("%c",&z);
getchar();
while(scanf("%c",&z)&&z != '\0')
{
if(z < &&z != ',')
{
scanf("%c %c",&y,&x);
cnt++;
sh[cnt].ch = z ;
sh[cnt].col = y- ;
sh[cnt].row = x- ;
}
else if(z != ',')
{
scanf("%c",&w);
cnt++;
sh[cnt].ch = 'p';
sh[cnt].col = z- ;
sh[cnt].row = w- ;
}
}
}
int ju(int i,int j)
{
if((i+j)% == )
return ;
else return ;
}
int main()
{
cnt = ;
/*coutt();
couttt();*/
cin>>s1;
//scanf("%c",&z);
getchar();
while(scanf("%c",&z)&&(z != '\n'))
{
if(z< && z!=',')
{
scanf("%c%c",&y,&x);
cnt++;
sh[cnt].ch = z ;
sh[cnt].col = y- ;
sh[cnt].row = x- ;
}
else if(z != ',')
{
scanf("%c",&w);
cnt++;
sh[cnt].ch = 'P';
sh[cnt].col = z- ;
sh[cnt].row = w- ;
}
}
cin>>s1;
scanf("%c",&z);
while(scanf("%c",&z)&& z!='\n')
{
if(z< && z!=',')
{
scanf("%c%c",&y,&x);
cnt++;
sh[cnt].ch = z +;
sh[cnt].col = y- ;
sh[cnt].row = x- ;
}
else if(z != ',')
{
scanf("%c",&w);
cnt++;
sh[cnt].ch = 'p';
sh[cnt].col = z- ;
sh[cnt].row = w- ;
}
}
sort(sh+,sh+cnt+,cmp);
int k = ;
printf("+---+---+---+---+---+---+---+---+\n");
for(i = ; i <= ; i++)
{
for(j = ; j <= ; j++)
{
int flag = ju(i,j);
printf("|");
if(flag) printf(":");
else printf(".");
if(sh[k].col == j&&sh[k].row ==-i)
{
printf("%c",sh[k++].ch);
}
else if(flag)
printf(":");
else
printf(".");
if(flag) printf(":");
else printf(".");
}
printf("|\n+---+---+---+---+---+---+---+---+\n");
}
return ;
}
POJ 2993Emag eht htiw Em Pleh的更多相关文章
- 模拟 POJ 2993 Emag eht htiw Em Pleh
题目地址:http://poj.org/problem?id=2993 /* 题意:与POJ2996完全相反 模拟题 + 字符串处理:无算法,读入两行字符串找出相应点用used标记,输出时标记过的输出 ...
- 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 ...
- 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 ...
- 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: ...
- 快速切题 poj 2993 Emag eht htiw Em Pleh 模拟 难度:0
Emag eht htiw Em Pleh Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2806 Accepted: ...
- POJ 2993:Emag eht htiw Em Pleh
Emag eht htiw Em Pleh Time Limit: 1000MS Memory Limit: 65536KB 64bit IO Format: %I64d & %I64 ...
- 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 ...
- Emag eht htiw Em Pleh(imitate)
Emag eht htiw Em Pleh Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2901 Accepted: ...
- 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 ...
随机推荐
- rest介绍
REST介绍 描述 rest即表述性状态传递(英文:Representational State Transfer,简称REST)是Roy Fielding博士在2000年他的博士论文中提出来的一种软 ...
- background-clip 背景图片做适当的裁剪
background-clip 用来将背景图片做适当的裁剪以适应实际需要. 语法: background-clip : border-box | padding-box | content-box | ...
- linux下dup/dup2函数的用法
系统调用dup和dup2能够复制文件描述符.dup返回新的文件文件描述符(没有用的文件描述符最小的编号).dup2可以让用户指定返回的文件描述符的值,如果需要,则首先接近newfd的值,他通常用来重新 ...
- JQuery window.opener
$('#Save').click(function () { var parent = $(parent.document.body); $(parent).find('input#add ...
- JQuery在页面中添加和除移DOM
1.before():将新节点添加到前面 2.after():将节点添加到低部 3.prepend():把节点变成第一个节点 4.append():把新节点添加到末端,与appendTo()效果相同, ...
- centos 减少tty数量的方法
在linux中,包括本文介绍的centos系统中,tty系统默认是给出7个,前六个是terminal,一个用于X. 在centos5.x中减少tty数量,通过修改/etc/inittab来实现. [r ...
- NavigationBar的简单设置
http://blog.csdn.net/hufeng825/article/details/7643532#) .Label属性设置 titleLabel = [[UILabel alloc] in ...
- How to check Windows 7 OS is permanently activated?[Windows 7]
Press Windows + R, then you can enter : slmgr.vbs -xpr
- 通过替换frm文件方式修改表结构
版本:5.6.16 在自己的虚拟环境中,测试创建一个表,表结构如下:mysql> drop table yoon_temp;Query OK, 0 rows affected (0.09 sec ...
- Python之回调魔法
Python中魔法(前后又下划线)会在对象的生命周期被回调. 借助这种回调, 可以实现AOP或者拦截器的思想. 在Python语言中提供了类似于C++的运算符重在功能:一下为Python运算符重在调用 ...