得分(Score,ACM/ICPC Seoul 2005,UVa 1585)

 

#include<stdio.h>
int main(void)
{
    char b;
    int t,cou,sum;
    scanf("%d",&t);
    getchar();
    while(t--)
    {
        cou=sum=0;
        while((b=getchar())!='\n')
        {
            if(b=='O')sum+=++cou;
            else cou=0;
        }
        printf("%d\n",sum);
    }
    return 0;
}

  

posted @ 2016-07-21 17:38  马丁黄瓜啊  阅读(331)  评论(0编辑  收藏  举报