有没有Py大佬帮忙看看,只有20分,我要裂开了
查看原帖
有没有Py大佬帮忙看看,只有20分,我要裂开了
695814
1182hh楼主2024/9/12 17:13

all=""

for scr in range(25000):

aim=input()
if "E" in aim:
    for i in aim:
        if i!="E":
            all=all+i
        else:    
            break
    break
else:
    all=all+aim

def hh(n):

me=0
you=0
for sim in all:
    if sim=="W": 
        me=me+1
        if me>=n and me-you>=2:
            print(f"{me}:{you}")
            me=0
            you=0
    else:
        you=you+1
        if you>=n and you-me>=2:
            print(f"{me}:{you}")
            me=0
            you=0
if you<n and me<n:
    print(f"{me}:{you}")
elif you>n and you-me<2:
    print(f"{me}:{you}")
elif me>n and me-you<2:
    print(f"{me}:{you}")

hh(11)

print("")

hh(21)

2024/9/12 17:13
加载中...