1052. 卖个萌 (20)
来源:互联网 发布:华为p7手机壳淘宝 编辑:程序博客网 时间:2024/06/02 05:21
#include<stdio.h>#include<string.h>void read_expression(char arry[][5], int *count){ char temp; int x=1,i=0; while((temp = getchar())!='\n') { if(temp=='[') { i=0; while((temp = getchar())!=']') { arry[x][i++] = temp; } arry[x][i] = '\0'; x++; } else { i=0; while((temp = getchar())!='[' && temp!='\n'); if(temp=='\n') break; while((temp = getchar())!=']' ) { arry[x][i++] = temp; } arry[x][i] = '\0'; x++; } } *count = x-1;}int main(){ char hand[11][5]; char eye[11][5]; char mouth[11][5],temp; int hand_num=0,eye_num=0,mouth_num=0; int N=0,i=0,a1,a2,a3,a4,a5; read_expression(hand, &hand_num); read_expression(eye, &eye_num); read_expression(mouth, &mouth_num); scanf("%d",&N); while(N--) { scanf("%d%d%d%d%d",&a1,&a2,&a3,&a4,&a5); if(a1>hand_num || a2>eye_num || a3>mouth_num ||a4>eye_num ||a5>hand_num) { printf("Are you kidding me? @\\/@\n"); } else if(a1<1 || a2<1 || a3<1 ||a4<1 ||a5<1) { printf("Are you kidding me? @\\/@\n"); } else { printf("%s(%s%s%s)%s\n",hand[a1],eye[a2],mouth[a3],eye[a4],hand[a5]); } } return 0;}
0 0
- 1052. 卖个萌 (20)
- 1052. 卖个萌 (20)
- 1052. 卖个萌 (20)
- 1052. 卖个萌 (20)
- 1052. 卖个萌 (20)
- 1052. 卖个萌 (20)
- 1052. 卖个萌 (20)
- 1052. 卖个萌 (20)
- 1052. 卖个萌 (20)
- 1052. 卖个萌 (20)
- 1052. 卖个萌 (20)
- 1052. 卖个萌 (20)
- 1052. 卖个萌 (20)
- 1052. 卖个萌 (20)
- 1052. 卖个萌 (20)
- 1052. 卖个萌 (20)
- 【PAT】1052. 卖个萌 (20)
- 1052. 卖个萌 (20) PAT
- [Unity对Excel的读取]
- java面试题之static和final
- matlab求解 非线性规划
- 关于UIAlertActionStyle的一些知识点
- Spring 注解配置(annotation-config 和 component-scan的不同)
- 1052. 卖个萌 (20)
- 1053. 住房空置率 (20)
- 如何安装nginx且使用反向代理
- 点击文本框阻止出现搜索记录
- 1054. 求平均值 (20)
- dfs八向搜索
- 2016搜索提高1004
- JSP中使用JSP模板
- 1055. 集体照 (25)