Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- int main()
- {
- char s[100];
- int a[100],t,i,j,k,c,sum,l;
- while(scanf("%d",&t)==1)
- {
- for(i=1;i<=t;i++)
- {
- scanf("%s",s);
- l=strlen(s);
- for(j=0;j<l;j++)
- {
- if(s[j]=='O')
- {
- a[j]=1;
- }
- if(s[j]=='X')
- {
- a[j]=0;
- }
- }
- c=0,sum=0;
- for(k=0;k<l;k++)
- {
- if(a[k]==1)
- {
- c++;
- }
- if(a[k]==0)
- {
- c=0;
- }
- sum=sum+c;
- }
- printf("%d\n",sum);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement