UVa-1585-得分
#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-得分的更多相关文章
- UVa 1585 Score --- 水题
题目大意:给出一个由O和X组成的串(长度为1-80),统计得分. 每个O的分数为目前连续出现的O的个数,例如,OOXXOXXOOO的得分为1+2+0+0+1+0+0+1+2+3 解题思路:用一个变量t ...
- 得分(Score, ACM/ICPC Seoul 2005,UVa 1585)
#include<cstdio>#include<cstdlib>#include<cstring>int main(){ char s[80];//输入OOXXO ...
- 得分(Score,ACM/ICPC Seoul 2005,UVa 1585)
#include<stdio.h> int main(void) { char b; int t,cou,sum; scanf("%d",&t); getcha ...
- UVa 1585 - Score
得分是目前连续O 的个数,遇到X置0 #include <cstdio> #include <iostream> #include <cstring> using ...
- UVa 1585 - Score - ACM/ICPC Seoul 2005 解题报告 - C语言
1.题目大意 给出一个由O和X组成的字符串(长度为80以内),每个O的得分为目前连续出现的O的数量,X得分为0,统计得分. 2.思路 实在说不出了,这题没过脑AC的.直接贴代码吧.=_= 3.代码 # ...
- uva 1585 Score(Uva-1585)
vj:https://vjudge.net/problem/UVA-1585 不多说水题一个o一直加x就加的变为0 我的代码 #include <iostream> #include &l ...
- UVa 1585 待解决
是在遇到第一个ooxx的时候会出错,会少算一个1 #include<stdio.h> int main() { int i,k=0,sum=0; char a[100]={"oo ...
- 【习题 3-1 UVA - 1585】Score
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 模拟水题 [错的次数] 在这里输入错的次数 [反思] 在这里输入反思 [代码] #include <bits/stdc++.h ...
- Score UVA - 1585
There is an objective test result such as "OOXXOXXOOO". An 'O' means a correct answer of ...
- 苏州大学ICPC集训队新生赛第二场
A - Score UVA - 1585 水 #include<bits/stdc++.h> using namespace std; int main(){ int n; cin> ...
随机推荐
- HK算法模板+小优化(跑的快一点点)
HUST 2604 #include <iostream> #include <cstdlib> #include <cstdio> #include <cs ...
- win10家庭版安装
https://www.microsoft.com/zh-cn/software-download/windows10ISO https://www.2cto.com/os/201704/621770 ...
- bzoj 4010: [HNOI2015]菜肴制作【拓扑排序】
也就是给定有向图,求最小字典序的拓扑序,直接用小根堆就行(或者反着建图用大根堆) #include<iostream> #include<cstdio> #include< ...
- IT兄弟连 JavaWeb教程 Servlet表单数据
很多情况下,需要传递一些信息,从浏览器到Web服务器,最终到后台程序.浏览器使用两种方法可将这些信息传递到Web服务器,分别为GET方法和POST方法. 1.GET方法 GET 方法向页面请求发送已编 ...
- 黑客攻防技术宝典web实战篇:解析应用程序习题
猫宁!!! 参考链接:http://www.ituring.com.cn/book/885 随书答案. 1. 当解析一个应用程序时,会遇到以下 URL:https://wahh-app.com/Coo ...
- PJzhang:lijiejie的敏感目录爆破工具BBScan
猫宁!!! 参考链接: https://www.freebuf.com/sectool/85729.html https://segmentfault.com/a/1190000014539449 这 ...
- websocket实现单聊
server# @File: ws from flask import Flask, request, render_template from geventwebsocket.handler imp ...
- WOJ1109 奶牛排队
题目链接: WOJ1109 题目描述: 奶牛在熊大妈的带领下排成了一条直队. 显然,不同的奶牛身高不一定相同-- 现在,奶牛们想知道,如果找出一些连续的奶牛,要求最左边的奶牛A是最矮的,最右边的B是最 ...
- Apache Kylin的框架介绍
不多说,直接上干货! Apache kylin 能提供低延迟(sub-second latency)的秘诀就是预计算,即针对一个星型拓扑结构的数据立方体,预计算多个维度组合的度量,然后将结果保存在hb ...
- 单页Html及Android App供小孩学习常用汉字
为了检验及帮助小孩学习常用汉字,简单开发本网页应用: 常用汉字是按使用频率排序的,来源于网上: 该简单应用 有Android APP下载 “学习常用汉字_20150910.apk” 单页Html 示例 ...