a054.
電話客服中心
--
板橋高中教學題
| From: [123.193.213.137] |
發表日期
:
2023-02-13 19:54
s=[int(i) for i in str(input())] #輸入 並轉為陣列(123變[1,2,3])
check=s[-1] #check=s的最後一項
s=s[0:-1] #刪除s的最後一項
data=["BNZ","AMW","KLY","JVX","HU","GT","FS","ER","DOQ","CIP"]
print(data[(10-(sum(list(s[i]*(8-i) for i in range(len(s))))%10+check))%10])
#sum(list(s[i]*(8-i) for i in range(len(s))) 計算x1*8 x2*7 x3*6...
#10-((sum+ans)%10)=check 移項前
#10-sum%10-check=ans%10 移項後