int main()
{
char a[100];
int c,i,l,n,sum,j;
scanf("%d",&n);
for(j=0;j<n;j++)
{
int t;
t=0,c=0;
sum=0;
scanf("%s",a);
l=strlen(a);
for(i=0;i<strlen(a);i++)
{
if(a[i]=='O')
{
c++;
sum=sum+c;
}
if(a[i]=='X')
{
c=0;
}
}
printf("%d\n",sum);
}
return 0;
}
0 comments:
Post a Comment