sicily 1324

#include <iostream> #include <string> using namespace std; int main() { int T; cin >> T; string s; while(T--) { cin >> s; int ans = 0; int k = 1; for(int i = 0; i < s.size(); i++) { if(s[i] == 'O') ans += k++; else k = 1; } cout << ans << endl; } return 0; } 

你可能感兴趣的:(include)