1 Python代码 2 3 txt = '''小学数学的坑爹题4 4 5 小学数学寒假作业中的变态题 6 某4位数乘以一位数,积也是4位数! 7 要求:只能使用1,2,3,4,5,6,7,8,9这九个数字,而且不能重复! 8 请问是:????× ?= ????''' 9 10 print(txt) 11 print('---'*11) 12 nmb = "123456789" 13 n = 0 14 print('答:') 15 for i in range(1234, 9877): 16 for v in range(1, 10): 17 s = i * v 18 stt = str(i) + str(v) + str(s) 19 if len(stt) > 9: 20 break 21 n = 0 22 for m in nmb: 23 if not m in stt: 24 break 25 else: 26 n+=1 27 if n == 9: 28 print( i,'x', v,'=', s) 29 input() 30 31 '''''--------------------------------- 32 答: 33 1738 x 4 = 6952 34 1963 x 4 = 7852 35 '''
标签:小学,stt,爹题,数学,str,print From: https://www.cnblogs.com/nxhujiee/p/18185913