UVA - 1585 Score

//得分 uva1585
//这题好像没什么特别的收获,标准水题

#include <iostream>
#include <cstring>
using namespace std;
int main()
{
	int m;
	cin >> m;
	char s[100];
	while (m--)
	{
		cin >> s;
	
		int n = strlen(s), t = 0, sum = 0;
		for (int i = 0; i < n; i++)
		{
			if (s[i] == 'O')
			{
				t++;
				sum += t;
			}
			else
			{
				t = 0;
			}
		}
		cout << sum << endl;
	}
	
	return 0;
}

posted @ 2017-09-02 11:22  mofushaohua  阅读(104)  评论(0编辑  收藏  举报