POJ 3765 Xiang Hex G++

#include <iostream> 
#include <string>
#include <cstdlib>
#include <vector>
using namespace std;
int main()
{
	vector<int> gg;
	vector<string> str;
	vector<char> jj;
	while(1)
	{
		int NUM;
		cin>>NUM;
		if(NUM==0)
		{
			break;
		}
		gg.push_back(NUM);
		for(int n=0;n<NUM;n++)
		{
			string s;
			char c;
			cin>>s>>c;
			str.push_back(s);
			jj.push_back(c);
		}
	}
	int star=0;
	for(int m=0;m<gg.size();m++)
	{
		int NUM;
		NUM=gg[m];
		char a[7];
		for(int n=0;n<7;n++)
		{
			a[n]=' ';
		}
		char b[8];
		for(int n=0;n<8;n++)
		{
			b[n]=' ';
		}	
		char c[9];
		for(int n=0;n<9;n++)
		{
			c[n]=' ';
		}
		char d[10];
		for(int n=0;n<10;n++)
		{
			d[n]=' ';
		}
		char e[11];
		for(int n=0;n<11;n++)
		{
			e[n]=' ';
		}
		char f[10];
		for(int n=0;n<10;n++)
		{
			f[n]=' ';
		}
		char g[9];
		for(int n=0;n<9;n++)
		{
			g[n]=' ';
		}
		char h[8];
		for(int n=0;n<8;n++)
		{
			h[n]=' ';
		}
		char i[7];
		for(int n=0;n<7;n++)
		{
			i[n]=' ';
		}
		for(int n=star;n<NUM+star;n++)
		{
			string wz;
			char zm;
			wz=str[n];
			zm=jj[n];
			if(wz[0]=='A')
			{
				a[atoi(wz.substr(1).c_str())]=zm;
			}else if(wz[0]=='B')
			{
				b[atoi(wz.substr(1).c_str())]=zm;
			}else if(wz[0]=='C')
			{
				c[atoi(wz.substr(1).c_str())]=zm;
			}else if(wz[0]=='D')
			{
				d[atoi(wz.substr(1).c_str())]=zm;
			}else if(wz[0]=='E')
			{
				e[atoi(wz.substr(1).c_str())]=zm;
			}else if(wz[0]=='F')
			{
				f[atoi(wz.substr(1).c_str())]=zm;
			}else if(wz[0]=='G')
			{
				g[atoi(wz.substr(1).c_str())]=zm;
			}else if(wz[0]=='H')
			{
				h[atoi(wz.substr(1).c_str())]=zm;
			}else if(wz[0]=='I')
			{
				i[atoi(wz.substr(1).c_str())]=zm;
			}
		}
		star=star+NUM;
   	 	cout<<"         _"<<endl;
   	 	cout<<"       _/"<<e[10]<<"\\_"<<endl;
   		 cout<<"     _/"<<d[9]<<"\\_/"<<f[9]<<"\\_"<<endl;
   	 	cout<<"   _/"<<c[8]<<"\\_/"<<e[9]<<"\\_/"<<g[8]<<"\\_"<<endl;
   		 cout<<" _/"<<b[7]<<"\\_/"<<d[8]<<"\\_/"<<f[8]<<"\\_/"<<h[7]<<"\\_"<<endl;
   		 cout<<"/"<<a[6]<<"\\_/"<<c[7]<<"\\_/"<<e[8]<<"\\_/"<<g[7]<<"\\_/"<<i[6]<<"\\"<<endl;
    	cout<<"\\_/"<<b[6]<<"\\_/"<<d[7]<<"\\_/"<<f[7]<<"\\_/"<<h[6]<<"\\_/"<<endl;
    	cout<<"/"<<a[5]<<"\\_/"<<c[6]<<"\\_/"<<e[7]<<"\\_/"<<g[6]<<"\\_/"<<i[5]<<"\\"<<endl;
		cout<<"\\_/"<<b[5]<<"\\_/"<<d[6]<<"\\_/"<<f[6]<<"\\_/"<<h[5]<<"\\_/"<<endl;
		cout<<"/"<<a[4]<<"\\_/"<<c[5]<<"\\_/"<<e[6]<<"\\_/"<<g[5]<<"\\_/"<<i[4]<<"\\"<<endl;
		cout<<"\\_/"<<b[4]<<"\\_/"<<d[5]<<"\\_/"<<f[5]<<"\\_/"<<h[4]<<"\\_/"<<endl;
		cout<<"/"<<a[3]<<"\\_/"<<c[4]<<"\\_/"<<e[5]<<"\\_/"<<g[4]<<"\\_/"<<i[3]<<"\\"<<endl;
		cout<<"\\_/"<<b[3]<<"\\_/"<<d[4]<<"\\_/"<<f[4]<<"\\_/"<<h[3]<<"\\_/"<<endl;
   	 	cout<<"/"<<a[2]<<"\\_/"<<c[3]<<"\\_/"<<e[4]<<"\\_/"<<g[3]<<"\\_/"<<i[2]<<"\\"<<endl;
		cout<<"\\_/"<<b[2]<<"\\_/"<<d[3]<<"\\_/"<<f[3]<<"\\_/"<<h[2]<<"\\_/"<<endl;
		cout<<"/"<<a[1]<<"\\_/"<<c[2]<<"\\_/"<<e[3]<<"\\_/"<<g[2]<<"\\_/"<<i[1]<<"\\"<<endl;
		cout<<"\\_/"<<b[1]<<"\\_/"<<d[2]<<"\\_/"<<f[2]<<"\\_/"<<h[1]<<"\\_/"<<endl;
		cout<<"/"<<a[0]<<"\\_/"<<c[1]<<"\\_/"<<e[2]<<"\\_/"<<g[1]<<"\\_/"<<i[0]<<"\\"<<endl;
		cout<<"\\_/"<<b[0]<<"\\_/"<<d[1]<<"\\_/"<<f[1]<<"\\_/"<<h[0]<<"\\_/"<<endl;
		cout<<"  \\_/"<<c[0]<<"\\_/"<<e[1]<<"\\_/"<<g[0]<<"\\_/"<<endl;
		cout<<"    \\_/"<<d[0]<<"\\_/"<<f[0]<<"\\_/"<<endl;
		cout<<"      \\_/"<<e[0]<<"\\_/"<<endl;
    	cout<<"        \\_/"<<endl;
	}
	return 0;
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值