刷题第七题:Score

tech2025-09-17  13

题目链接:https://vjudge.net/problem/UVA-1585 题解:水题 代码: #include #include #include #define maxn 110 using namespace std; int main() { char s[maxn];//最小 int len; int n; int ans,fl; cin>>n; while(n–) { fl=0; ans=0; cin>>s; for(int i=0;s[i]!=0;i++) { if(s[i]‘X’) fl=0; else if(s[i]‘O’) { fl++; ans+=fl; } } cout<<ans<<endl; } return 0; }

List item
最新回复(0)