#include <iostream>
#include <string>
#include <vector>
using namespace std;
void get(vector<string>& character){
string input;
int i,j;
getline(cin,input);
for(i=0,j=1;j<input.size();j++){
if(input[i]!='[')
{
i++;continue;
}
if(input[j]==']' && character.size()<=10)
{
string temp=input.substr(i+1,j-i-1);
// cout<<temp<<endl;
character.push_back(temp);
i=j+1;
}
}
}
int main(int argc, char** argv) {
int i,k,lh,le,m,rh,re; //lh 左手 le 左眼睛 m 口 rh 右手
string input;
vector<string> hand,eye,mouth;
get(hand);
get(eye);
get(mouth);
cin>>k;
for(i=0;i<k;i++)
{
cin>>lh>>le>>m>>re>>rh;
if(lh-1>hand.size() || rh-1>hand.size() || le>eye.size() ||
re>eye.size() || m>mouth.size())
{
cout<<"Are you kidding me? @\\/@"<<endl;
}
else
{
cout<<hand[lh-1]<<"("<<eye[le-1]<<mouth[m-1]<<eye[re-1]<<")"<<hand[rh-1]<<endl;
}
}
return 0;
}
PAT乙级1052
最新推荐文章于 2022-02-27 23:34:25 发布
本文介绍了一个使用C++编写的程序,该程序能够从输入中解析并生成各种表情符号,包括手部、眼睛和嘴巴的不同形态组合。通过读取标准输入获取手部、眼睛和嘴巴的样式列表,然后根据用户的指令生成具体的表情符号。

647

被折叠的 条评论
为什么被折叠?



