#include<stdio.h>
#include<string.h>
#define maxn 1000000
char s[maxn];
int main()
{
scanf("%s", s);
int i;
int t=0,sum=0;
for (i = 0; i < strlen(s); i++) {
if (s[i] == 'X') {
t = 0;
}
if (s[i] == 'O') {
t++;
}
if (t != 0) {
sum += t;
}
}
printf("%d", sum);
return 0;
}
算法竞赛--得分3.1
最新推荐文章于 2024-09-06 10:38:06 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)