与这道题刚好相反


他要做的是把原来输出的,变成现在输入的,原来输入的,变成现在输出的。

#include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <limits>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
//#include <unordered_map>
//#include <unordered_set>
#define lowbit(x) ( x&(-x) )
#define pi 3.141592653589793
#define e 2.718281828459045
#define eps 1e-8
#define INF 0x3f3f3f3f
#define HalF (l + r)>>1
#define lsn rt<<1
#define rsn rt<<1|1
#define Lson lsn, l, mid
#define Rson rsn, mid+1, r
#define QL Lson, ql, qr
#define QR Rson, ql, qr
#define myself rt, l, r
#define MP(x, y) make_pair(x, y)
using namespace std;
typedef unsigned long long ull;
typedef unsigned int uit;
typedef long long ll;
map<char, int> mp;
char s[17][36]=
{{"+---+---+---+---+---+---+---+---+\n\0"},  //0{"|...|:::|...|:::|...|:::|...|:::|\n\0"},  //1{"+---+---+---+---+---+---+---+---+\n\0"},  //2{"|:::|...|:::|...|:::|...|:::|...|\n\0"},  //3{"+---+---+---+---+---+---+---+---+\n\0"},  //4{"|...|:::|...|:::|...|:::|...|:::|\n\0"},  //5{"+---+---+---+---+---+---+---+---+\n\0"},  //6{"|:::|...|:::|...|:::|...|:::|...|\n\0"},  //7{"+---+---+---+---+---+---+---+---+\n\0"},  //8{"|...|:::|...|:::|...|:::|...|:::|\n\0"},  //9{"+---+---+---+---+---+---+---+---+\n\0"},  //10{"|:::|...|:::|...|:::|...|:::|...|\n\0"},  //11{"+---+---+---+---+---+---+---+---+\n\0"},  //12{"|...|:::|...|:::|...|:::|...|:::|\n\0"},  //13{"+---+---+---+---+---+---+---+---+\n\0"},  //14{"|:::|...|:::|...|:::|...|:::|...|\n\0"},  //15{"+---+---+---+---+---+---+---+---+\n\0"},  //16
};
char w[205], b[205];
void init()
{mp['K'] = mp['k'] = 1;mp['Q'] = mp['q'] = 2;mp['R'] = mp['r'] = 3;mp['B'] = mp['b'] = 4;mp['N'] = mp['n'] = 5;mp['P'] = mp['p'] = 6;
}
inline int fid_x(int x) { return (x - 1) * 4 + 2; }
inline int fid_y(int y) { return (8 - y) * 2 + 1; }
int main()
{init();int len, x, y;scanf("White: ");scanf("%s\n", w);len = (int)strlen(w);for(int i=0, j; i<len; ){j = i;while(w[j] ^ ',') j++;if(j - i == 3){x = w[i + 1] - 'a' + 1;y = w[i + 2] - '0';s[fid_y(y)][fid_x(x)] = w[i];}else{x = w[i] - 'a' + 1;y = w[i + 1] - '0';s[fid_y(y)][fid_x(x)] = 'P';}i = j + 1;}scanf("Black: ");scanf("%s\n", b);len = (int)strlen(b);for(int i=0, j; i<len; ){j = i;while(b[j] ^ ',') j++;if(j - i == 3){x = b[i + 1] - 'a' + 1;y = b[i + 2] - '0';s[fid_y(y)][fid_x(x)] = b[i] + 32;}else{x = b[i] - 'a' + 1;y = b[i + 1] - '0';s[fid_y(y)][fid_x(x)] = 'p';}i = j + 1;}for(int i=0; i<17; i++) printf("%s", s[i]);return 0;
}

Emag eht htiw Em Pleh【模拟】相关推荐

  1. POJ 2993 Emag eht htiw Em Pleh 模拟

    http://poj.org/problem?id=2993 模拟大法好. 1 #include<iostream> 2 #include<cstdio> 3 #include ...

  2. POJ 2993 Emag eht htiw Em Pleh(模拟)

    题目链接 只要理解了题意之后,就不是很难了.学长们,把题意讲的很明白了.:和.交替出现,坐标系是按平常数学上的坐标系建法.居然1Y了,意外. 1 #include <cstdio> 2 # ...

  3. POJ 2993 Emag eht htiw Em Pleh (模拟)

    题目链接,点这里 思路:先把棋盘准备好,再往里填棋子((行号+列号)%2 == 0放的是-,否则放的是:::),这就是棋盘准备的过程 出自博主:https://www.cnblogs.com/mobi ...

  4. Emag eht htiw Em Pleh POJ - 2993

    Emag eht htiw Em Pleh POJ - 2993 题目链接:https://vjudge.net/problem/POJ-2993 题意:Help Me with the Game P ...

  5. POJ 2993【Emag eht htiw Em Pleh】

    题目链接 思路: 如果之前写的Help Me with the Game(Blog) 是一道一题,那么 "Emag eht htiw Em Pleh" 恐怕也是. 代码: 644K ...

  6. POJ 刷题系列:2993. Emag eht htiw Em Pleh

    POJ 刷题系列:2993. Emag eht htiw Em Pleh 传送门:2993. Emag eht htiw Em Pleh 题意: 与2996相反,给出所有棋子的坐标关系,可视化boar ...

  7. POJ2993 Emag eht htiw Em Pleh

    一. 思路分析 通过建立字符串数组来模拟棋盘,棋盘的内容由"+-|.:"等符号填充,将输入的两个字符串转化为棋盘上的位置坐标,再依次输出字符串数组. 二. 方法设计 1.定义一下变 ...

  8. 盘棋析解之”Emag eht htiw Em Pleh“

    题目大意: 输入两行字符串代表棋子位置. 打印棋盘. 跟 解析棋盘之"Help Me with the Game" 正好相反. 样例: White: Ke1,Qd1,Ra1,Rh1 ...

  9. POJ 2993, Emag eht htiw Em Pleh

    模拟类 Description This problem is a reverse case of the problem 2996. You are given the output of the ...

最新文章

  1. 使用VC内嵌Python实现的一个代码检测工具
  2. 分析增加站点权重的四大切入点(转载)
  3. HDU1074 Doing Homework
  4. eventEmitter3源码分析与学习
  5. mysql:视图,触发器,事务,存储过程,函数
  6. kafka 集群的部署安装
  7. vue 获取请求url_vue 获取url里参数的两种方法小结
  8. run till exit from #0_华为认证hcip H13821 v2.0云服务考试真题每日一练(一)
  9. dedecms二次开发常用代码
  10. java 继承对象 初始化_java中具有继承关系的类及其对象初始化顺序
  11. Jordan Lecture Note-9: Principal Components Analysis (PCA).
  12. 使用AndroidStudio时 R标红的一些问题总结
  13. [转载] Java中final关键字
  14. CSDN APP又出错了,看不到博文
  15. 国密 SM4 高并发服务 加压测服务 加生成秘钥 结合上篇一起使用 国密 SM2 SM3 SM4 后续升级版本,内容丰富单独写一篇百万压测4000毫秒加解密
  16. 国内直接下载google play谷歌商店apk安装包的网站【https://apkpure.com/】
  17. aardio修改图标
  18. python读取文件夹下所有txt_Python读取文件夹中TXT文档
  19. FCN全卷积网络模型——高分辨率遥感影像地物识别
  20. BUAA(2021春)第一次上机选择+填空(含解析)

热门文章

  1. 数据库系统-SimpleDB
  2. Java JDK下载、安装与环境变量配置
  3. python解析html用哪个模块_[转载]python模块学习---HTMLParser(解析HTML文档元素)
  4. 安全加固——Windows系统安全加固
  5. 黑苹果用uhd630_5款手机必备超好用黑科技APP!追剧办公两不误,安卓苹果通用...
  6. 如何将汉语拼音转换为音素+声调数字
  7. 爬虫采集自己构建代理ip池有什么优势?
  8. 不同摄像头的精度测试
  9. 常用开源监控系统分析推荐
  10. Python全小写,全大写,首字母大写