//得分 uva1585//这题好像没什么特别的收获,标准水题#include#include using namespace std;int main(){ int m; cin >> m; char s[100]; while (m--) { cin >> s; int n = strlen(s), t = 0, sum = 0; for (int i = 0; i < n; i++) { if (s[i] == 'O') { t++; sum += t; } else { t = 0; } } cout << sum << endl; } return 0;}