L1-075 強迫症 python

豆豆是只乖狗狗發表於2024-06-29

python 實現

s=input()
year=s[:len(s)-2]
month=s[len(s)-2:len(s)]

if len(year)==4:
    print("{year}-{month}".format(year=year, month=month))
else:
    if int(year)<22:
        print("20{year}-{month}".format(year=year,month=month))
    elif int(year)<100:
        print("19{year}-{month}".format(year=year,month=month))

相關文章