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. CentOS 5.8 升级php版本

    一:我们都知道系统的yum源安装出来的php版本不是5.1的就是5.3  那就是说 有些程序不支持那么低的版本的呢 那我们该怎么办呢 接下来 简单的说下php的版本升级  编译升级太慢了 这里我们选择 ...

  2. html5 app开发重大消息-腾讯在技术端推进Html5生态发展

    中新网5月3日电 日前,腾讯正式发布腾讯浏览服务(Tencent Browser Service,以下简称TBS),宣布为合作伙伴提供整合腾讯底层技术.内容框架.广告体系以及大数据等多方面能力的升级浏 ...

  3. ios 控件

    反序列化 JSONModel 上拉刷新 下拉加载更多 MJRefresh AFNetworking 2.5 Asynchronous image downloader with cache - SDW ...

  4. 为checkboxSelectionModel赋值

    store.on('load', function(store, records, options) { sm.clearSelections();   //清空数据 Ext.each(records ...

  5. openerp - asterisk connector(转载)

    原文:http://www.akretion.com/open-source-contributions/openerp-asterisk-voip-connector OpenERP - Aster ...

  6. 打包python脚本为exe可执行文件-pyinstaller和cx_freeze示例

    本文介绍使用cx_freeze和pyinstaller打包python脚本为exe文件 cx_freeze的使用实例 需要使用到的文件wxapp.py, read_file.py, setup.py ...

  7. 每日一“酷”之bisect

    作用:维护有序列表,而不必在每次想列表增加一个元素时调用sort排序 bisect 模块实现了一个算法用于向列表中插入元素,同时仍保持列表有序.有些情况下,这比反复对一个了表序列更高效,另外也比构建一 ...

  8. 自定义一个WPF的PathButton

    一.背景 做项目时总是少不了Button,但是普通的Button大家都不喜欢用,总是想要自定义的Button,正好项目中用到不要边框的Button,并且是形状也是根据功能不同而变化的,并且窗口程序是会 ...

  9. django 更新model

    修改models.py 中对应的class 在admin.py 中 增加 admin.site.register(WafDevice) 进入dbshell python manage.py dbshe ...

  10. 如何在LINUX VPS上安装VPN详细步骤

    在vps上安装vpn是个难点,很多朋友都不会,这儿结合一位朋友的安装经验做下介绍.注意你的vps要安装做vpn使用,一定要注意你的流量限制,使用Vpn上游戏上youtube看视频等都比较耗费资源,否则 ...