Question 习题3-1 得分(Score ACM-ICPC Seoul 2005,UVa1585) 题目:给出一个由O和X组成的串(长度为1~80),统计得分. 每个O的分数为目前连续出现的O的个数,X的得分为0. 例如:OOXXOXXOOO的得分为1+2+0+0+1+0+0+1+2+3. DescriptionThere is an objective test result such as OOXXOXXOOO. An `O' means a correct answer of a p…
#include <stdio.h> int main(){ int T, O, score; char str[81], *p; scanf("%d", &T); while (T--) { scanf("%s", str); O = score = 0; for (p = str; *p; ++p) { if (*p == 'O') …