标签:tac pre using clu sum names while pop stack
#include <bits/stdc++.h> using namespace std; int main() { int k; cin>>k; stack<int> score; int t=1; string s; while(k--) { t=1; cin>>s; int len=s.size(); for(int i=0;i<len;i++) { if(s[i]==‘O‘) score.push(t++); if(s[i]==‘X‘) { t=1; } } int sum=0; while(!score.empty()) { sum+=score.top(); score.pop(); } cout<<sum<<endl; } }
标签:tac pre using clu sum names while pop stack
原文地址:http://www.cnblogs.com/masterchd/p/6821294.html