시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 15640 8424 7489 56.683%

문제

"OOXXOXXOOO"와 같은 OX퀴즈의 결과가 있다. O는 문제를 맞은 것이고, X는 문제를 틀린 것이다. 문제를 맞은 경우 그 문제의 점수는 그 문제까지 연속된 O의 개수가 된다. 예를 들어, 10번 문제의 점수는 3이 된다.

"OOXXOXXOOO"의 점수는 1+2+0+0+1+0+0+1+2+3 = 10점이다.

OX퀴즈의 결과가 주어졌을 때, 점수를 구하는 프로그램을 작성하시오.

입력

첫째 줄에 테스트 케이스의 개수가 주어진다. 각 테스트 케이스는 한 줄로 이루어져 있고, 길이가 0보다 크고 80보다 작은 문자열이 주어진다. 문자열은 O와 X만으로 이루어져 있다.

출력

각 테스트 케이스마다 점수를 출력한다.

예제 입력 1

5
OOXXOXXOOO
OOXXOOXXOO
OXOXOXOXOXOXOX
OOOOOOOOOO
OOOOXOOOOXOOOOX

예제 출력 1

10
9
7
55
30
W3sicHJvYmxlbV9pZCI6Ijg5NTgiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJPWFx1ZDAzNFx1Yzk4OCIsImRlc2NyaXB0aW9uIjoiPHA+JnF1b3Q7T09YWE9YWE9PTyZxdW90O1x1YzY0MCBcdWFjMTlcdWM3NDAgT1hcdWQwMzRcdWM5ODhcdWM3NTggXHVhY2IwXHVhY2ZjXHVhYzAwIFx1Yzc4OFx1YjJlNC4gT1x1YjI5NCBcdWJiMzhcdWM4MWNcdWI5N2MgXHViOWRlXHVjNzQwIFx1YWM4M1x1Yzc3NFx1YWNlMCwgWFx1YjI5NCBcdWJiMzhcdWM4MWNcdWI5N2MgXHVkMmMwXHViOWIwIFx1YWM4M1x1Yzc3NFx1YjJlNC4gXHViYjM4XHVjODFjXHViOTdjIFx1YjlkZVx1Yzc0MCBcdWFjYmRcdWM2YjAgXHVhZGY4IFx1YmIzOFx1YzgxY1x1Yzc1OCBcdWM4MTBcdWMyMThcdWIyOTQgXHVh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mRhcmQgb3V0cHV0LiBQcmludCBleGFjdGx5IG9uZSBsaW5lIGZvciBlYWNoIHRlc3QgY2FzZS4gVGhlIGxpbmUgaXMgdG8gY29udGFpbiB0aGUgc2NvcmUgb2YgdGhlIHRlc3QgY2FzZS4mbmJzcDs8XC9wPlxyXG4iLCJoaW50IjoiIiwib3JpZ2luYWwiOiIxIiwicHJvYmxlbV9sYW5nX2NvZGUiOiJcdWM2MDFcdWM1YjQifV0=

출처

ACM-ICPC > Regionals > Asia > Korea > Asia Regional - Seoul 2005 A번

  • 문제를 번역한 사람: baekjoon
  • 문제의 오타를 찾은 사람: jh82582