其他分享
首页 > 其他分享> > 1052 卖个萌

1052 卖个萌

作者:互联网

在这里插入图片描述

输入样例:

[╮][╭][o][~\][/~]  [<][>]
 [╯][╰][^][-][=][>][<][@][⊙]
[Д][▽][_][ε][^]  ...
4
1 1 2 2 2
6 8 1 5 5
3 3 4 3 3
2 10 3 9 3

输出样例:

╮(╯▽╰)╭
<(@Д=)/~
o(^ε^)o
Are you kidding me? @\/@
#include<iostream>
#include<vector>
using namespace std;
int main(){
	vector<vector<string> > v;
	for(int i=0;i<3;i++){
		string s;
		getline(cin,s);
		vector<string> row;
		int j=0,k=0;
		while(j<s.size()){
			if(s[j]=='['){	
				while(k++<s.size()){
					if(s[k]==']'){
						row.push_back(s.substr(j+1,k-j-1));
						break;
					}
				}
			}
            j++;
		}
		v.push_back(row);
	} 
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		int a,b,c,d,e;
		cin>>a>>b>>c>>d>>e;
		if(a>v[0].size()||b>v[1].size()||c>v[2].size()||d>v[1].size()||e>v[0].size()||a<1||b<1||c<1||d<1||e<1){
			cout << "Are you kidding me? @\\/@" << endl;
			continue;
		}
		cout<<v[0][a-1]<<"("<<v[1][b-1]<<v[2][c-1]<<v[1][d-1]<<")"<<v[0][e-1]<<endl;
	}
	return 0;
}

标签:std,1052,int,卖个,样例,include,size
来源: https://blog.csdn.net/weixin_43490369/article/details/104746256