#include<stdio.h>
#include<string.h>
int main ()
{
char a[100]= {},b[100]= {},c;
int n,i=0,j,count=1,k=0,sum=0,t;
scanf("%d",&n);
c=getchar();
if(n<1)
return 0;
while(n--)
{
gets(a);
t=strlen(a);
for(i=0; i<t; i++)
{
if (a[i] == 'O')
{
sum += count;
if( i < t - 1 && a[i+1] == 'O')
{
count ++;
}
else
count = 1;
}
}
printf ("%d\n",sum);
sum=0;
memset(a,0,sizeof(a));
memset(b,0,sizeof(b));
}
return 0;
}
1585 score
最新推荐文章于 2022-08-15 18:52:43 发布