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. 从零开始搭建TestCpp工程

    目标: 创建一个测试工程,测试工程以列表的方式展示,没一个列表项对应一个场景 1. 创建cocos2d-x工程       现在采用脚本的方式来创建,好处是一次可以创建N个项目的工程.      首先 ...

  2. NSS_05 数据访问选型

    在数据访问层上很想用orm框架, 选用Nhibernate或ef, 可以直接操作类对象, 避免转换, 更加的面向对象,更重要的是开发起来就方便多了. 但是从网上了解到这些框架太高级了, 用得不好到时会 ...

  3. 从java到php

    从大一开始就开始接触java这门语言.但是在这之前也接触了vb,c,asp等等开发语言,唯独java让人感觉严谨,清爽,各种数据之间的不拖泥带水.这才花费更多时间去研究他.但是学着学着,发现他体系的庞 ...

  4. 内部技术分享的 PPT

    本文的基础是搞了一次内部的技术分享,在此也分享一下本次的PPT的一些内容.先列一下大概内容吧. EF-Code First API(WCF.WebAPI) Xaml MVVM AOP Xamarin. ...

  5. 【转载】Powershell设置世纪互联Office365嵌套组发送权限

    Start-Transcript ".\Set-GroupSendPermisionLog.txt" -Force function Get-DLMemberRecurse { $ ...

  6. c语言知识点总结(摘自head first c)

    gcc name.c -o name;   ./name或者gcc name.c -o name &&  ./name;同时执行关键字:void sizeof(运算符,它能告诉你某样东 ...

  7. 批量kill mysql processlist进程

    如果大批量的操作能够通过一系列的select语句产生,那么理论上就能对这些结果批量处理.但是mysql并没用提供eval这样的对结果集进行分析操作的功能.所以只能现将select结果保存到临时文件中, ...

  8. CentOS 7.0安装MPlayer

    自带的播放器不管rmvb还是mp4都不能播放,也搜索不到解码器. CentOS7epel装不上所以也没有rpmfusion,所以决定自己编译mplayer 首先是要获取源代码. 首先是主程序的源代码. ...

  9. 从零开始学ios开发(九):Swapping Views

    这篇的内容是切换Views,也是上一篇中提到的第三种当iphone发生旋转后改变布局的方式,先回顾一下上一篇中提到的三种方式 1.使用Autosizing 2.写code 3.重新弄个View,替换原 ...

  10. iOS 进阶 第八天(0407)

    0407 UIPickerView.UIDatePicker和UIToolBar请参见视频和代码 pch文件 #ifdef __OBJC__ //在这里面写oc的引用,比如一些oc的头文件或者NSLo ...