题目
#!/usr/bin/python
# -*- coding: UTF-8 -*-
while True:
num = int(input('plaese input the correct number: '))
i = num // 1000
if i <= 9 and i>=1:
break
a = [0] * 4
a[0] = i
a[1] = (num - i * 1000) // 100
a[2] = (num-a[0]*1000-a[1]*100)//10
a[3] = num % 10
for i in range(4):
a[i] = (a[i] + 5) % 10
a[0],a[3] = a[3],a[0]
a[1],a[2] = a[2],a[1]
原文地址:https://www.cnblogs.com/lovely-bones/p/11668013.html
时间: 2024-11-02 07:15:56