1052. 卖个萌 (20)
来源:互联网 发布:mysql sql语句 编辑:程序博客网 时间:2024/06/02 04:05
#include <math.h>#include <stdio.h> char hand[10][5],eye[10][5],mouse[10][5];int get_symbol(char p[][5]) //读取符号{char c,i=0,j=0;while( (c=getchar()) !='\n'){if( c == '['){while( (c=getchar()) != ']' ){if(c == '\n') return (i-1);p[i][j] = c;j++;}p[i][j] = '\0'; i++;j=0;}}return (i-1);}main(){int hand_count,eye_count,mouse_count;int n,i,a1,a2,a3,a4,a5; hand_count = get_symbol(hand);eye_count = get_symbol(eye);mouse_count = get_symbol(mouse);scanf("%d",&n);for(i=0;i<n;i++){scanf("%d%d%d%d%d",&a1,&a2,&a3,&a4,&a5);if(--a1 > hand_count || --a5 > hand_count || --a2 > eye_count || --a4 > eye_count || --a3 > mouse_count) //注意下标越界的情况{puts("Are you kidding me? @\\/@");}else if(a1 < 0 || a2 < 0 || a3 < 0 || a4 < 0 || a5< 0) //注意下标小于0的情况{puts("Are you kidding me? @\\/@");}else{printf("%s(%s%s%s)%s\n",hand[a1],eye[a2],mouse[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
- C#详解struct和class的区别
- C/C++中inline/static inline/extern inline的区别及使用
- 聊聊毕业设计
- LINQ 优点 总结
- 向MySQL中插入1000条测试数据--存储过程
- 1052. 卖个萌 (20)
- [CodeForces 567D] One-Dimensional Battle Ships (区间隔断计数)
- 原型图登录优化
- 欢迎来到我的博客
- 序列化和反序列化
- Ubuntu12.04中weka的使用
- c++:warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
- C++语法细节-静态成员
- Eclipse下导入PagerSlidingTabStrip的解决方案