#31081: py 對新手有善


ray.951022@gmail.com (阿睿)

學校 : 臺北市立內湖高級工業職業學校
編號 : 138435
來源 : [27.247.65.35]
最後登入時間 :
2024-07-13 15:31:01
a020. 身分證檢驗 | From: [220.132.86.173] | 發表日期 : 2022-07-10 09:53

#start
ts = 0
num = input()
num1 = int(num[1])
num2 = int(num[2])
num3 = int(num[3])
num4 = int(num[4])
num5 = int(num[5])
num6 = int(num[6])
num7 = int(num[7])
num8 = int(num[8])
num9 = int(num[9])

numall = num1*8+num2*7+num3*6+num4*5+num5*4+num6*3+num7*2+num8+num9
eng = str(num[0])


if eng == 'A':
    numall = numall+10
elif eng == 'B':
    numall = numall+10
elif eng == 'C':
    numall = numall+1+(2*9)
elif eng == 'D':
    numall = numall+1+(3*9)
elif eng == 'E':
    numall = numall+1+(4*9)
elif eng == 'F':
    numall = numall+1+(5*9)
elif eng == 'G':
    numall = numall+1+(6*9)
elif eng == 'H':
    numall = numall+1+(7*9)
elif eng == 'I':
    numall = numall+3+(4*9)
elif eng == 'J':
    numall = numall+1+(8*9)
elif eng == 'K':
    numall = numall+1+(9*9)
elif eng == 'L':
    numall = numall+2
elif eng == 'M':
    numall = numall+2+(1*9)
elif eng == 'N':
    numall = numall+2+(2*9)
elif eng == 'O':
    numall = numall+3+(5*9)
elif eng == 'P':
    numall = numall+2+(3*9)
elif eng == 'Q':
    numall = numall+2+(4*9)
elif eng == 'R':
    numall = numall+2+(5*9)
elif eng == 'S':
    numall = numall+2+(6*9)
elif eng == 'T':
    numall = numall+2+(7*9)
elif eng == 'U':
    numall = numall+2+(8*9)
elif eng == 'V':
    numall = numall+2+(9*9)
elif eng == 'W':
    numall = numall+3+(2*9)
elif eng == 'X':
    numall = numall+3+(0*9)
elif eng == 'Y':
    numall = numall+3+(1*9)
elif eng == 'Z':
    numall = numall+3+(3*9)

if numall % 10 == 0:
    print('real')
else:
    print('fake')

 
#35059: Re: py 對新手有善


yp11151128@yphs.tp.edu.tw (80833)

學校 : 臺北市私立延平高級中學
編號 : 225479
來源 : [203.72.178.1]
最後登入時間 :
2024-01-15 11:29:52
a020. 身分證檢驗 | From: [203.72.178.1] | 發表日期 : 2023-05-05 08:46

#start
ts = 0
num = input()
num1 = int(num[1])
num2 = int(num[2])
num3 = int(num[3])
num4 = int(num[4])
num5 = int(num[5])
num6 = int(num[6])
num7 = int(num[7])
num8 = int(num[8])
num9 = int(num[9])

numall = num1*8+num2*7+num3*6+num4*5+num5*4+num6*3+num7*2+num8+num9
eng = str(num[0])


if eng == 'A':
    numall = numall+10
elif eng == 'B':
    numall = numall+10
elif eng == 'C':
    numall = numall+1+(2*9)
elif eng == 'D':
    numall = numall+1+(3*9)
elif eng == 'E':
    numall = numall+1+(4*9)
elif eng == 'F':
    numall = numall+1+(5*9)
elif eng == 'G':
    numall = numall+1+(6*9)
elif eng == 'H':
    numall = numall+1+(7*9)
elif eng == 'I':
    numall = numall+3+(4*9)
elif eng == 'J':
    numall = numall+1+(8*9)
elif eng == 'K':
    numall = numall+1+(9*9)
elif eng == 'L':
    numall = numall+2
elif eng == 'M':
    numall = numall+2+(1*9)
elif eng == 'N':
    numall = numall+2+(2*9)
elif eng == 'O':
    numall = numall+3+(5*9)
elif eng == 'P':
    numall = numall+2+(3*9)
elif eng == 'Q':
    numall = numall+2+(4*9)
elif eng == 'R':
    numall = numall+2+(5*9)
elif eng == 'S':
    numall = numall+2+(6*9)
elif eng == 'T':
    numall = numall+2+(7*9)
elif eng == 'U':
    numall = numall+2+(8*9)
elif eng == 'V':
    numall = numall+2+(9*9)
elif eng == 'W':
    numall = numall+3+(2*9)
elif eng == 'X':
    numall = numall+3+(0*9)
elif eng == 'Y':
    numall = numall+3+(1*9)
elif eng == 'Z':
    numall = numall+3+(3*9)

if numall % 10 == 0:
    print('real')
else:
    print('fake')

你打錯了

 
ZeroJudge Forum