#include <stdio.h>
#include <string.h>
int main()
{
char s[100];
int T;
scanf("%d",&T);
while (T--) {
scanf("%s",s);
int len=strlen(s);
int cnt=0,score=0;
for (int i=0;i<len;i++) {
if (s[i]=='O')
cnt++;
else
cnt=0;
score+=cnt;
}
printf("%d\n",score);
}
}

UVa-1585-得分的更多相关文章

  1. UVa 1585 Score --- 水题

    题目大意:给出一个由O和X组成的串(长度为1-80),统计得分. 每个O的分数为目前连续出现的O的个数,例如,OOXXOXXOOO的得分为1+2+0+0+1+0+0+1+2+3 解题思路:用一个变量t ...

  2. 得分(Score, ACM/ICPC Seoul 2005,UVa 1585)

    #include<cstdio>#include<cstdlib>#include<cstring>int main(){ char s[80];//输入OOXXO ...

  3. 得分(Score,ACM/ICPC Seoul 2005,UVa 1585)

    #include<stdio.h> int main(void) { char b; int t,cou,sum; scanf("%d",&t); getcha ...

  4. UVa 1585 - Score

    得分是目前连续O 的个数,遇到X置0 #include <cstdio> #include <iostream> #include <cstring> using ...

  5. UVa 1585 - Score - ACM/ICPC Seoul 2005 解题报告 - C语言

    1.题目大意 给出一个由O和X组成的字符串(长度为80以内),每个O的得分为目前连续出现的O的数量,X得分为0,统计得分. 2.思路 实在说不出了,这题没过脑AC的.直接贴代码吧.=_= 3.代码 # ...

  6. uva 1585 Score(Uva-1585)

    vj:https://vjudge.net/problem/UVA-1585 不多说水题一个o一直加x就加的变为0 我的代码 #include <iostream> #include &l ...

  7. UVa 1585 待解决

    是在遇到第一个ooxx的时候会出错,会少算一个1 #include<stdio.h> int main() { int i,k=0,sum=0; char a[100]={"oo ...

  8. 【习题 3-1 UVA - 1585】Score

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 模拟水题 [错的次数] 在这里输入错的次数 [反思] 在这里输入反思 [代码] #include <bits/stdc++.h ...

  9. Score UVA - 1585

    ​ There is an objective test result such as "OOXXOXXOOO". An 'O' means a correct answer of ...

  10. 苏州大学ICPC集训队新生赛第二场

    A - Score UVA - 1585 水 #include<bits/stdc++.h> using namespace std; int main(){ int n; cin> ...

随机推荐

  1. c++常见面试题30道

    1.new.delete.malloc.free关系 delete会调用对象的析构函数,和new对应free只会释放内存,new调用构造函数.malloc与free是C++/C语言的标准库函数,new ...

  2. dfs,bfs的二分匹配模板(模板题hdu1150)

    如果不懂匈牙利算法,请点击:该趣味算法http://blog.csdn.net/dark_scope/article/details/8880547 模板: //DFS版本下的二分匹配算法 http: ...

  3. 手机测试用例-STK测试用例

    ID 功能描述 操作步骤 预期结果 test time P/F comment tester test time P/F comment tester STK服务 SIM卡适应性测试 1.选取支持ST ...

  4. Contest Hunter 0103最短Hamilton路径 【状压dp】 By cellur925

    题目传送门 Hamilton路径的定义:从0(起点)到n-1(终点)不重不漏地经过每个点恰好一次. 由于数据范围非常小,考虑状压.如NOIP2017宝藏一题,把状态压缩设为n个点是否已到达的二进制数. ...

  5. git 保存文件目录

    Ubuntu中git clone就保存在你命令行现在所在的目录里 所以最好推荐 先用cd这个命令去自己想保存的目录 之后再git clone

  6. C# BitmapData和Marshal.Copy()用法

    C# BitmapData和Marshal.Copy()用法 //此函数用法例子如下: public static byte[] GetGrayArray(Bitmap srcBmp, Rectang ...

  7. Codeforces Round #418 (Div. 2) B

    Description Sengoku still remembers the mysterious "colourful meteoroids" she discovered w ...

  8. 当不知道基本数据类型的取值范围时,可以通过max_value等来查询

    public class Demo03{ public static void main(String[] args){ System.out.println("int MAX " ...

  9. Objective-C和 C++ 混编的要点(转)

    Using C++ With Objective-C苹果的Objective-C编译器允许用户在同一个源文件里自由地混合使用C++和Objective-C,混编后的语言叫Objective-C++.有 ...

  10. RedHat改yum源免费使用CentOS源

    linux默认是安装了yum软件的,但是由于激活认证的原因让redhat无法直接进行yum安装一些软件 如果我们需要在redhat下直接yum安装软件,我们只用把yum的源修改成CentOS的就好了, ...