Accepted
代码
#include <iostream>
#include<cstring>
using namespace std;
const int maxn=85;
char s[maxn]={0};
int main() {
cin>>s;
int len=strlen(s);
int value=0,sum=0;
for(int i=0;i<len;i++){
if(s[i]=='O')value++;
else value=0;
sum+=value;
}
cout<<sum;
return 0;
}