Python3 代码
number = [61, 71, 11, 21, 32, 19, 27, 31]
city = ["Brasilia", "Salvador","Sao Paulo","Rio de Janeiro","Juiz de Fora","Campinas","Vitoria","Belo Horizonte"]
x = input()
found = False
for i in range (0,8):
if eval(x) == number[i]:
found = True
print(city[i])
break
if found == False:
print("DDD nao cadastrado")