UVa 1585 Score (score)

How to calculate your score it? Such as "OOXXOXXOOO". "O" represents the correct answer to the question, "X" represents the wrong answer. So it is by its own score and it just before continuous 'O' only if the answer is correct.

For example, the fraction of the 10 questions are of its own and its two previous consecutive "0" obtained 3.

Thus, "OOXXOXXOOO" score is the "1 + 2 + 0 + 0 + 1 + 0 + 0 + 1 + 2 + 3" 10 calculated. You have to write a test result is calculated scores of programs. Entry

A first line of input integer T, represented by the T test composition.

In each test line contains the string 'O' and 'X' composed of the start, and length of the string is more than 0 to 80. between 'O' and 'X' with no spaces. The output of each test case output one line. The bank is the fraction containing the test case. Sample Output 5

OOXXOXXOOO

OOXXOOXXOO

OXOXOXOXOXOXOX

onestic

OOOOXOOOOXOOOOX

Sample Output

10

9

7

55

30

 

answer:





























    }
    return 0;
}

Guess you like

Origin www.cnblogs.com/satans/p/11108604.html