UVa1585

#include<stdio.h>
#include<string.h>
char s[100];
int main(){
	int  n;
	scanf("%d",& n);
	while (n--)
	{
		int m = 0, t = 0, i = 0;
		scanf("%s", s);
		while (i <= strlen(s) - 1)
		{
			if (s[i] == 'X') m = 0;
			else
			{
				m++;
				t += m;
			}
			i++;
		}
		printf("%d\n", t);
	}
	return 0;
}

你可能感兴趣的:(UVa1585)