1052. 卖个萌 (20)--Python
来源:互联网 发布:母婴店软件 编辑:程序博客网 时间:2024/06/14 18:51
虽然自己跑着没问题,但是测试总说返回为零,应该是程序炸了,先记录下来,然后再改。
def get_list(a):a = ''.join(a.split())list_1 = list(a)list_2 = []length = len(list_1)#print(list_1)while list_1:i = 0if list_1[i] == '[':flag = ''list_1.pop(i)#print(list_1)j = 0while list_1[j] != ']':flag += list_1[j]j += 1#print(flag)list_2.append(flag)list_1.pop(j)list_1 = list_1[j:]i += 1return list_2a = input()b = input()c = input()num = input()num = int(num)list_hand = get_list(a)list_eye = get_list(b)list_mouth = get_list(c)length_hand = len(list_hand)length_eye = len(list_eye)length_mouth = len(list_mouth)for i in range(num):my_flag_list = ''flag = Falselist = input().split()for n in list:if n <= '0':flag = Truehand_left = int(list[0])eye_left = int(list[1])mouth = int(list[2])eye_right = int(list[3])hand_right = int(list[4])if (hand_left > length_hand):flag = Trueif (hand_right > length_hand):flag = Trueif (eye_left > length_eye):flag = Trueif (eye_right > length_eye):flag = Trueif (mouth > length_mouth):flag = Trueif flag == False:my_flag_list = list_hand[int(list[0]) -1] + '(' + list_eye[int(list[1]) - 1] + list_mouth[int(list[2]) - 1] + list_eye[int(list[3]) - 1] + ')' +list_hand[int(list[4]) -1]else:my_flag_list = 'Are you kidding me? @' + '\\' + '/@'print(''.join(my_flag_list))
阅读全文
0 0
- 1052. 卖个萌 (20)--Python
- Python学习笔记20:Python Web编程
- Python Exercise #20
- python手记(20)
- Python 练习实例20
- 20 Python __all__
- Python练习实例20
- python技巧(20)
- 1028. 人口普查(20) python
- Python学习笔记20
- python练习题 11-20
- Python-20 集合:唯一
- 1028. 人口普查(20)--Python
- Python学习---20
- Python 练习实例20
- 1057. 数零壹(20)--Python
- 1058. 选择题(20)--Python
- Python
- 一张图熟知yarn资源调度流程
- codeforce 777c Alyona and Spreadsheet
- PostgreSQL安装后Navicat客户端连接报错:Could not connect to server:Connection refused(0x00002740/10061)
- 2017-12-1 7周5次课 linux防火墙--netfilter
- js中的事件委托或是事件代理详解——为未创建的元素添加事件、对批量元素添加事件
- 1052. 卖个萌 (20)--Python
- 。
- 心田庄园:12月10日周日下午广州Linuxer聚会
- OKhttp源码学习(一)—— 基本请求流程
- ARM学习资料
- Linux操作系统学习资料
- Linux驱动编程
- 欢迎使用CSDN-markdown编辑器
- OKhttp源码学习(二)—— OkHttpClient