python语言 样例通过了,但全WA 望大佬指点一二
查看原帖
python语言 样例通过了,但全WA 望大佬指点一二
757943
719713334_楼主2022/8/3 14:30
def pq11(score):
    hua=0
    huadui=0
    for i in score:
        if i =='W':
            hua+=1
        elif i=='L':
            huadui+=1
        elif i=='E':
            print(hua,':',huadui)
            break
        if((hua>=11 and hua-huadui>=2) or (huadui>=11 and huadui-hua>=2)):
            print(hua,':',huadui)
            hua=0
            huadui=0
def pq21(score):
    hua=0
    huadui=0
    arr=[]
    for i in score:
        if i =='W':
            hua+=1
        elif i=='L':
            huadui+=1
        elif i=='E':
            print(hua,':',huadui)
            break
        if((hua>=21 and hua-huadui>=2) or (huadui>=21 and huadui-hua>=2)):
            print(hua,':',huadui)
            hua=0
            huadui=0
score=''
while True:
    score_temp=map(str,input().strip().split())
    score_temp = list(score_temp)
    score += score_temp[0]
    if 'E' in score_temp[0]:
        break

pq11(score)
print('')
pq21(score)
2022/8/3 14:30
加载中...