24 lines
447 B
C
24 lines
447 B
C
#include <stdio.h>
|
|
|
|
int main() {
|
|
int n;
|
|
scanf("%d",&n);
|
|
while(n--) {
|
|
char string[80];
|
|
scanf("%s",string);
|
|
int res = 0, score = 0;
|
|
for(int i=0; string[i]!='\0'; i++) {
|
|
if(string[i]=='O') {
|
|
score++;
|
|
res += score;
|
|
}
|
|
else if(score!=0) {
|
|
score = 0;
|
|
}
|
|
}
|
|
|
|
printf("%d\n",res);
|
|
}
|
|
|
|
return 0;
|
|
} |