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的更多相关文章

  1. 模拟 POJ 2993 Emag eht htiw Em Pleh

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

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

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

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

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

  6. POJ 2993:Emag eht htiw Em Pleh

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

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

  8. Emag eht htiw Em Pleh(imitate)

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

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

随机推荐

  1. Windows Phone 8仿Toast弹出通知。

    Wp8后台收到消息可以弹出Toast通知,可是应用在前台跑的时候却好像没有办法弹出Toast通知.而需求上有要求要弹出Toast通知,在这种情况下,就开始考虑是否能够做一个类似Toast的弹出通知呢? ...

  2. ☆RHEL6创建软raid的使用☆——经典之作

    raid主要的种类 1.raid0  扩展卷   raid 0又称Stripee或Striping,中文译为集带工作方式, 有时也可以理解为拼凑. 它是将要存取的数据以条带状的形式尽量平均分配到多个硬 ...

  3. WP开发笔记——字符串 转 MD5 加密

    将字符串进行MD5加密,返回加密后的字符串. 从这里下载Md5.cs文件:http://pan.baidu.com/s/1hq3gpnu. 添加到Windows Phone 7项目中,在代码里面这样调 ...

  4. HMTL5的 video 在IOS7中碰到的坑

    直接说问题吧, 测试设备,ipod 我们在移动端播放视频的时候,一般使用H5的video标签,OK,这里有几点差异(就我目前所发现的)给大家分享一下, 1.在IOS7中,video元素是需要确定大小的 ...

  5. C#中泛型和单链表

      泛型是 2.0 版 C# 语言和公共语言运行库 (CLR) 中的一个新功能.泛型将类型参数的概念引入 .NET Framework,类型参数使得设计如下类和方法成为可能:这些类和方法将一个或多个类 ...

  6. TCP连接,传输数据时的粘包问题讨论

    第一个需要讨论的大概就是粘包问题了.因为这个是TCP的个性问题,UDP通信时不存在这个问题的.首先看一下什么叫粘包: 客户端采取与服务器的长连接方式建立通信(Open-Write/Read-Write ...

  7. 连续子数组的最大和/1007. Maximum Subsequence Sum (25)

    题目描述 HZ偶尔会拿些专业问题来忽悠那些非计算机专业的同学.今天测试组开完会后,他又发话了:在古老的一维模式识别中,常常需要计算连续子向量的最大和,当向量全为正数的时候,问题很好解决.但是,如果向量 ...

  8. Allegro中板子边框不封闭导致的z-copy无法用的问题

    画一个不规则的边框,有半圆形状,导致边框不封闭,无法使用Z-COPY命令,下边是解决办法: 1 画好Outline后,选择 shape -> Compose Shape , options选项卡 ...

  9. 爱重启的windows,伤不起

    .

  10. cdev_系列函数

    内核中每个字符设备都对应一个 cdev 结构的变量,下面是它的定义: linux-2.6.22/include/linux/cdev.h struct cdev {    struct kobject ...