문제출처 : https://www.acmicpc.net/problem/8958
#include <iostream>
using namespace std;
int main()
{
int T;
string arr;
cin >> T;
for (int i = 0; i < T; i++)
{
int score = 1, totalscore = 0;
cin >> arr;
for (int j = 0; j < arr.size(); j++)
{
if (arr[j] == 'O')
{
totalscore += score;
score++;
}
else
score = 1;
}
cout << totalscore<<'\n';
}
return 0;
}