#Python TQC考題208_十進位換算
n = int(input())
#輸入浮點數會錯誤,改為
# n=int(eval(input()))
#把input用eval轉為數值,
#再將數值用int取整數(無條件捨去法)
if n <=9:
print(n)
elif n == 10:
print(“A”)
elif n == 11:
print(“B”)
elif n == 12:
print(“C”)
elif n == 13:
print(“D”)
elif n == 14:
print(“E”)
elif n == 15:
print(“F”)
Spyder執行結果:
近期留言