Emag eht htiw Em Pleh(imitate)
Time Limit: 1000MS | Memory Limit: 65536K | |
Total Submissions: 2901 | Accepted: 1917 |
Description
Input
Output
Sample Input
White: Ke1,Qd1,Ra1,Rh1,Bc1,Bf1,Nb1,a2,c2,d2,f2,g2,h2,a3,e4
Black: Ke8,Qd8,Ra8,Rh8,Bc8,Ng8,Nc6,a7,b7,c7,d7,e7,f7,h7,h6
Sample Output
+---+---+---+---+---+---+---+---+
|.r.|:::|.b.|:q:|.k.|:::|.n.|:r:|
+---+---+---+---+---+---+---+---+
|:p:|.p.|:p:|.p.|:p:|.p.|:::|.p.|
+---+---+---+---+---+---+---+---+
|...|:::|.n.|:::|...|:::|...|:p:|
+---+---+---+---+---+---+---+---+
|:::|...|:::|...|:::|...|:::|...|
+---+---+---+---+---+---+---+---+
|...|:::|...|:::|.P.|:::|...|:::|
+---+---+---+---+---+---+---+---+
|:P:|...|:::|...|:::|...|:::|...|
+---+---+---+---+---+---+---+---+
|.P.|:::|.P.|:P:|...|:P:|.P.|:P:|
+---+---+---+---+---+---+---+---+
|:R:|.N.|:B:|.Q.|:K:|.B.|:::|.R.|
+---+---+---+---+---+---+---+---+
Source
#include<stdio.h>
#include<string.h>
#include<ctype.h>
char chess[][] ;
char st[] = "+---+---+---+---+---+---+---+---+" ;
char s1[] = "|...|:::|...|:::|...|:::|...|:::|" ,s2[] = "|:::|...|:::|...|:::|...|:::|...|" ;
char color[] ;
char ch ;
int row , col; int main ()
{
// freopen ("a.txt" , "r" , stdin) ;
for (int i = ; i <= ; i++) {
if (i & ) {
strcpy (chess[i] , st) ;
}
else {
if ((i >> ) & )
strcpy (chess[i] , s1) ;
else
strcpy (chess[i] , s2) ;
}
}
gets (color) ;
int len = strlen (color) ;
color [len] = ',' ;
color [len + ] = '\0' ;
color [] = ',' ; for (int i = ; color[i] != '\0' ; i ++) {
int cnt = ;
if (color[i] == ',') {
for (int j = i - ; cnt < ; j-- , cnt++) {
if (cnt == )
row = ( - (color[j] - '') ) * ;
if (cnt == )
col = (color [j] - 'a') * + ;
if (cnt == ) {
if (color[j] == ',')
ch = 'P' ;
else
ch = color[j] ;
}
}
}
chess[row][col] = ch ;
} gets (color) ;
len = strlen (color) ;
color [len] = ',' ;
color [len + ] = '\0' ;
color [] = ',' ; for (int i = ; color[i] != '\0' ; i ++) {
int cnt = ;
if (color[i] == ',') {
for (int j = i - ; cnt < ; j-- , cnt++) {
if (cnt == )
row = ( - (color[j] - '') ) * ;
if (cnt == )
col = (color [j] - 'a') * + ;
if (cnt == ) {
if (color[j] == ',')
ch = 'p' ;
else
ch = tolower (color[j]) ;
}
}
}
chess[row][col] = ch ;
} for (int i = ; i <= ; i++)
puts (chess[i]) ; return ;
}
Emag eht htiw Em Pleh(imitate)的更多相关文章
- poj 2993 Emag eht htiw Em Pleh(模拟)
题目:http://poj.org/problem?id=2993 题意:和2996反着 #include <iostream> #include<cstdio> #inclu ...
- 模拟 POJ 2993 Emag eht htiw Em Pleh
题目地址:http://poj.org/problem?id=2993 /* 题意:与POJ2996完全相反 模拟题 + 字符串处理:无算法,读入两行字符串找出相应点用used标记,输出时标记过的输出 ...
- 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
1.Link: http://poj.org/problem?id=2993 2.Content: Emag eht htiw Em Pleh Time Limit: 1000MS Memory ...
- 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 ...
- 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 ...
- 快速切题 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【模拟画棋盘】
链接: http://poj.org/problem?id=2993 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=27454#probl ...
- 模拟 + 打表 --- Emag eht htiw Em Pleh
Emag eht htiw Em Pleh Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2578 Accepted: ...
随机推荐
- 怎样写 OpenStack Neutron 的 Extension (一)
前两篇文章讨论了怎么写一个 Neutron 的插件.但是最基本的插件只包括 Network, Port,和 Subnet 三种资源.如果需要引入新的资源,比如一个二层的 gateway 的话,就需要在 ...
- js方式清空表单数据的两种方式
方法1:遍历页面元素 /* 清空FORM表单内容 id:表单ID*/ function ClearForm(id) { var objId = document.getElementByI ...
- Java学习笔记(四)——google java编程风格指南(上)
[前面的话] 年后开始正式上班,计划着想做很多事情,但是总会有这样那样的打扰,不知道是自己要求太高还是自我的奋斗意识不够?接下来好好加油.好好学学技术,好好学习英语,好好学习做点自己喜欢的事情,趁着自 ...
- 01.C#数据类型、排序、过滤(一章1.1-1.2)
随着看的文章及探讨越多,越发现自己实在太不定性了,看下<C#深入理解>吧,做一下读书笔记,从中发现自己的不足.闲话不说,进入正题吧. 在C#1中定下一个简单的数据类型 public cla ...
- WPF MenuItem 四种角色分析
Menu Menu的样式很简单,就是顶部的那个框,如下图 而其中的文字“文件”“图形”...是属于MenuItem的,要灵活使用MenuItem,就需要了解MenuItem.Role的作用 T ...
- ListView 和 Adapter用法
一个ListView通常有两个职责. (1)将数据填充到布局. (2)处理用户的选择点击等操作. 第一点很好理解,ListView就是实现这个功能的.第二点也不难做到,在后面的学习中读者会发现,这非常 ...
- WebView加载本地html、js文件常见问题及解决办法
声明:基于android studio平台,php语言搭建服务器 目录: 一.JavaScript脚本语言没有反应 二.alert无法弹出 三.html页面之间不能跳转 四.屏幕缩放没有达到预期效果 ...
- 搭建andiord sdk和安装eclipse adt插件的个人小体会
由于以前就已经搭建好了java jdk的运行环境这里就不多说了,不过这几天看了一篇博客才明白jdk变量环境设置的某些要义,不在是人云亦云而不知其所以然. 其博客的地址:http://www.cnblo ...
- HTTP协议强化理解
一:第一波 1. 是什么? 答:是一种定义超文本在网络中如何进行传输的协议! 所有的WWW上的文件都必须遵循! 是基于TCP/IP. 传输路径: 客户端<——>服务端 (全双工) ...
- SQLHelper用到的配置文件格式
格式要牢记 <configuration> <connectionStrings> <add name="dbConnStr" connectionS ...