题意:用一个标识位统计出现多少个连续的o。
/* ***********************************************
Author :Lu_cky
Created Time :2016年06月10日 星期五 18时08分08秒
File Name :main.cpp
************************************************ */
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <time.h>
#define LL long long
using namespace std;
const int SIZE=1e3+10;
const int maxn=1<<30;
char s[110];
int main()
{
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
int T;
scanf("%d",&T);
for(int cas=1;cas<=T;cas++){
scanf("%s",s);
int f=0,ans=0;
for(int i=0;s[i]!='\0';i++){
if(s[i]=='O'){
f++;
ans+=f;
}
else f=0;
}
printf("%d\n",ans);
}
return 0;
}