[Score, ACM/ICPC Seoul 2005, UVA1585]
吐槽!!!
我好心让最后一行不\n
,结果直接wrong answer,全部换行结果AC…
#include <stdio.h>
char s[85];void showScore(char *s) {int sum = 0;//int tagOfx = 1;int numOfo = 0;for(int i=0; s[i]!='\0'; ++i) {if(s[i] == 'O') {sum += ++numOfo;}else {//tagOfx=1;numOfo=0;}}printf("%d\n", sum);
}int main() {int T;//freopen("test.txt", "r", stdin);scanf("%d", &T);while(T--) {scanf("%s", s);showScore(s);}return 0;
}