文章
67
粉丝
207
获赞
29
访问
34.8k
while True:
str = ["a"]*100
str = list(input().split())
sum = 0
summax = 0
count = 0
index = 0
for i in range(0,len(str)):
if str[i] == "+":
if sum ==0:
index += 1
summax = summax + sum
sum = 0
count = 0
continue
if str[i] == "=":
if sum == 0:
index += 1
summax = summax + sum
break
if count !=0:
sum = sum * 10
if str[i] == "one":
count +=1#位
sum+=1
elif str[i] == "two":
count +=1
sum+=2
elif str[i] == "three":
count +=1
sum+=3
elif str[i] == "four":
count +=1
sum+=4
elif str[i] == "five":...
登录后发布评论
python刷题尽量加上try...except...