POJ2996Help Me with the Game
来源:互联网 发布:暴风vr电视直播软件 编辑:程序博客网 时间:2024/05/29 02:54
简单的模拟题,1a
#include<cstdio>#include<cstring>#include<cstdlib>#include<cmath>#include<algorithm>#include<stack>#include<queue>using namespace std;char Map[40][40];int t;void readMap(){for(int i=0;i<17;i++)scanf("%s",Map[i]);}char tracol(int x){switch(x){case 0 :return 'a'; case 1 :return 'b';case 2 :return 'c';case 3 :return 'd';case 4 :return 'e';case 5 :return 'f';case 6 :return 'g';case 7 :return 'h';}return '0';}void printMap(){printf("\n");for(int i=0;i<17;i++)printf("%s\n",Map[i]);}void findchW(char ch,int f){for(int i=15;i>0;i-=2)for(int j=0;j<32;j++)if(Map[i][j]==ch){if(t>0)printf(",");t=1;if(f){if(ch>='a'&&ch<='z')printf("%c",ch-32);elseprintf("%c",ch);}printf("%c%d",tracol(j/4),8-i/2);}}void findchB(char ch,int f){for(int i=1;i<16;i+=2)for(int j=0;j<32;j++)if(Map[i][j]==ch){if(t>0)printf(",");t=1;if(f){if(ch>='a'&&ch<='z')printf("%c",ch-32);elseprintf("%c",ch);}printf("%c%d",tracol(j/4),8-i/2);}}void check(){t=0;printf("White: ");findchW('K',1);findchW('Q',1);findchW('R',1);findchW('B',1);findchW('N',1);findchW('P',0);printf("\n");t=0;printf("Black: ");findchB('k',1);findchB('q',1);findchB('r',1);findchB('b',1);findchB('n',1);findchB('p',0);}int main(){readMap();//printMap();check();return 0;}
0 0
- POJ2996Help Me with the Game
- poj2996Help Me with the Game
- POJ2996Help Me with the Game
- POJ2996Help Me with the Game
- Help Me with the Game
- Help Me with the Game
- Help Me with the Game
- Poj 2996 Help Me with the Game
- POJ 2996 Help Me with the Game
- poj 2996 Help Me with the Game
- poj 2996 Help Me with the Game
- POJ 2996 Help Me with the Game
- POJ 2996 Help Me with the Game
- POJ 2996 Help Me with the Game
- poj2996 Help Me with the Game
- poj 2996 Help Me with the Game
- poj2996--Help Me with the Game
- poj-2996 Help Me with the Game
- 温湿度传感器si7020-a20 linux驱动编写
- 初识贪心:POJ2393--Yogurt factory
- Juicer 中文文档
- 简便使用命令行跑脚本
- listView刷新单个Item
- POJ2996Help Me with the Game
- Java类的初始化
- PHP函数之error_reporting
- CF703D. Mishka and Interesting sum
- EventBus3.0,使用过程中所有的梗。
- 区分使用Axis2和CXF的wsdl2java命令
- Mysql CPU占用高的问题解决方法小结
- hdu 5615 (Jam's math problem)
- 手机号码正则表达式js校验