数组中数据类型转换至int错误
m=int(input())
s=[]
a=0
while a!=1:
s.append(input().split())
a+=1
n=0
c=0
while(n<m):
q=s[n]
p=str(q)
if(p.isdigit()):
x=int(p)
else:
print(“notdefined”)
n+=1
if(x<0 or x>100):
print(“X”)
c+=1
if(x<60):
print(“E”)
if(60<=x<69):
print(“D”)
if(70<=x<79):
print(“C”)
if(80<=x<89):
print(“B”)
if(90<=x<=100):
print(“A”)
print(c)输入都是纯数字但是没法进行int转换。
推荐文章: