UVa-1585 Score
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
char a[85]={};
cin>>a;
int k=strlen(a);
int b=0,sum=0;
for(int i=0;i<k;i++)
{
if(a[i]=='O')
{
++b;
sum+=b;
}
else
b=0;
}
cout<<sum<<endl;
}
}