UVA-1585 Score
1 #include <iostream> 2 #include <stdlib.h> 3 #include <string> 4 #include <vector> 5 #include <algorithm> 6 #include <string.h> 7 #include <stack> 8 #include <unordered_map> 9 #include <math.h> 10 11 using namespace std; 12 13 int main() 14 { 15 int T; 16 cin >> T; 17 while(T --) 18 { 19 string input; 20 cin >> input; 21 int result = 0; 22 int continuityEleNum = 1; 23 for(auto c:input) 24 { 25 if(c=='O') 26 result += continuityEleNum++; 27 else 28 continuityEleNum = 1; 29 } 30 cout << result << endl; 31 } 32 return 0; 33 }