#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
const int maxn = 1e2 + 5;
char s[maxn];
int main(){
int t; cin>>t;
while(t--) {
scanf("%s", s);
int len = strlen(s);
int sum = 0, ans = 0;
for(int i = 0; i < len; ++i){
if(s[i] == 'O'){
++sum;
ans += sum;
}
else {
sum = 0;
}
}
printf("%d\n", ans);
}
return 0;
}
章三习题1——UVA 1585
最新推荐文章于 2020-09-16 21:16:16 发布