章三习题1——UVA 1585
来源:互联网 发布:网络视频传输方案 编辑:程序博客网 时间:2024/06/05 06:24
#include <cstdio>#include <cstring>#include <iostream>using namespace std;const int maxn = 1e2 + 5;char s[maxn];int main(){ int t; cin>>t; while(t--) { scanf("%s", s); int len = strlen(s); int sum = 0, ans = 0; for(int i = 0; i < len; ++i){ if(s[i] == 'O'){ ++sum; ans += sum; } else { sum = 0; } } printf("%d\n", ans); } return 0;}
0 0
- 章三习题1——UVA 1585
- 章三习题3——UVA 1225
- 章三习题4——UVA 455
- 章三习题8——UVA 202 Repearing Decimals
- 【习题3-1】 UVA - 1585 Score
- UVa 1585 Score(习题3-1)
- C++学习笔记——第二章习题(三)
- 习题三(1)
- 小紫书 习题 3-1(UVA 1585) 得分(Score)
- uva 673 Parentheses Balance 习题6-1 (栈——基础练习)
- 紫书章三习题5——UVA 227 Puzzle
- UVA 10118 紫书习题9—2
- 习题1—3
- 习题1—5
- 习题1—4
- 习题1—6
- 习题2—1
- 第三章 习题(三)
- ArrayList源码分析
- Unable to resolve target 'android-9'问题解决
- 公钥私钥
- js柯里化
- PAT甲级1019. General Palindromic Number (20)
- 章三习题1——UVA 1585
- Algorithm
- 安装两个Eclipse 版本不一致,高版本无法打开
- Eclipse如何安装GrepCode插件详细教程
- java关键字this的用法
- 阿里云服务器上搭建zookeeper的错误及解决
- 冒泡排序
- Android 7.0系统启动流程分析
- Only the original thread that created a view hierarchy can touch its views