#include <stdio.h>
#include <string.h>
int main(){
char hand[40]={0},eye[40]={0},mouth[40]={0};
int n,a;
gets(hand);
gets(eye);
gets(mouth);
scanf("%d",&n);
while(n--){
char out[20];
int v=0,flag=1;
for(int i=0;i<5;i++){
scanf("%d",&a);
int k=0,tag=1,tt=0;
if(i==0||i==4){
for(int j=0;j<strlen(hand);j++){
if(hand[j]=='['){ //手
tt=1;
k++;
}
else if(hand[j]==']'){
tt=0;
}
else if(k==a&&tt){
out[v++]=hand[j];
tag=0;
}
}
}
if(i==1||i==3){ //眼
if(i==1)
out[v++]='(';
for(int j=0;j<strlen(eye);j++){
if(eye[j]=='['){
tt=1;
k++;
}
else if(eye[j]==']'){
tt=0;
}
else if(k==a&&tt){
out[v++]=eye[j];
tag=0;
}
}
if(i==3)
out[v++]=')';
}
if(i==2){
for(int j=0;j<strlen(mouth);j++){ //嘴
if(mouth[j]=='['){
tt=1;
k++;
}
else if(mouth[j]==']'){
tt=0;
}
else if(k==a&&tt){
out[v++]=mouth[j];
tag=0;
}
}
}
if(tag){ //如果表情序号未找到,标记失败
flag=0;
}
}
if(flag){ //如果不是失败
out[v]='\0';
printf("%s\n",out);
}
else
printf("Are you kidding me? @\\/@\n");
memset(out,0,sizeof(out));
}
return 0;
}
1052 卖个萌 (20 分)
最新推荐文章于 2021-08-03 12:32:36 发布
该程序主要接收三个字符串输入(手、眼、嘴),然后根据用户输入的表情序号,从这三个字符串中提取相应的字符,重组形成新的表情。程序会检查每个部分的表情序号是否存在,若所有部分都找到则输出新表情,否则输出错误提示。
211

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



