power-girl0-0

[ 8958 ] OX퀴즈 본문

백준 알고리즘/python

[ 8958 ] OX퀴즈

power-girl0-0 2021. 3. 2. 12:24
728x90

num = int(input())

for i in range(num):
    ox = list(str(input()))
    score = 0
    cnt = 1
    
    for j in ox:
        if(j == 'O'):
            score += cnt
            cnt += 1
        else:
            cnt = 1
    print(score)
728x90

'백준 알고리즘 > python' 카테고리의 다른 글

[ 1546 ] 평균  (0) 2021.03.02
[ 3052 ] 나머지  (0) 2021.03.02
[ 2577 ] 숫자의 개수  (0) 2021.03.02
[ 2562 ] 최댓값  (0) 2021.03.02
[ 10818 ] 최소, 최대  (0) 2021.03.02
Comments