#24413: python爛解


Swarfte (Swarfte Chau)

學校 : 澳門理工學院
編號 : 145298
來源 : [205.215.4.197]
最後登入時間 :
2023-11-17 19:37:16
a020. 身分證檢驗 | From: [60.246.209.30] | 發表日期 : 2021-02-16 11:52

number = input()
number_list =list(number)
DDD = {"A" :"10" ,"B" :"11","C":"12","D":"13","E":"14","F":"15","G":"16","H":"17","I":"34","J":"18","K":"19","L":"20","M":"21","N":"22","O":"35","P":"23","Q":"24","R":"25","S":"26","T":"27","U":"28","V":"29","W":"32","X":"30","Y":"31","Z":"33"}
number_list[0] = DDD[number_list[0]]
run_time_1 = len(number_list)
for run in range(run_time_1):
    number_list[run] = eval(number_list[run])
ans = ""
for run in range(run_time_1):
    ans += str(number_list[run])
ans = list(ans)
ans = ans[::-1]
for run in range(len(ans)):
    ans[run] = eval(ans[run])
for run in range(len(ans)-2):
    ans[run+1] = ans[run+1] * (run+1)
chcek_num = 0
for run in range(len(ans)):
    chcek_num += ans[run]
check = chcek_num % 10
if check == 0 :
    print ("real")
else :
    print ("fake")
 
#24429: Re:python爛解


mark0516 (Mark)

學校 : 不指定學校
編號 : 135235
來源 : [111.241.197.95]
最後登入時間 :
2022-09-18 20:23:51
a020. 身分證檢驗 | From: [150.116.198.74] | 發表日期 : 2021-02-17 10:17

number = input()
number_list =list(number)
DDD = {"A" :"10" ,"B" :"11","C":"12","D":"13","E":"14","F":"15","G":"16","H":"17","I":"34","J":"18","K":"19","L":"20","M":"21","N":"22","O":"35","P":"23","Q":"24","R":"25","S":"26","T":"27","U":"28","V":"29","W":"32","X":"30","Y":"31","Z":"33"}
number_list[0] = DDD[number_list[0]]
run_time_1 = len(number_list)
for run in range(run_time_1):
    number_list[run] = eval(number_list[run])
ans = ""
for run in range(run_time_1):
    ans += str(number_list[run])
ans = list(ans)
ans = ans[::-1]
for run in range(len(ans)):
    ans[run] = eval(ans[run])
for run in range(len(ans)-2):
    ans[run+1] = ans[run+1] * (run+1)
chcek_num = 0
for run in range(len(ans)):
    chcek_num += ans[run]
check = chcek_num % 10
if check == 0 :
    print ("real")
else :
    print ("fake")

不用那麼難吧!

 
ZeroJudge Forum