给出一个由O和X组成的串(长度为1~80),统计得分。每个O的得分为目前连续出现的O的个数,X的得分为0。
例如:OOXXOXXOOO的得分为1+2+0+0+1+0+0+1+2+3。
#include<bits/stdc++.h>
using namespace std;
int count(char s[])
{
int i,sum,cnt=0;
给出一个由O和X组成的串(长度为1~80),统计得分。每个O的得分为目前连续出现的O的个数,X的得分为0。
例如:OOXXOXXOOO的得分为1+2+0+0+1+0+0+1+2+3。
#include<bits/stdc++.h>
using namespace std;
int count(char s[])
{
int i,sum,cnt=0;