uva 1585 Score
2016-04-09 21:24
357 查看
#include<iostream> using namespace std; int main() { int t; cin>>t; while(t--) { string a; cin>>a; int cnt=0; int sum=0; for(int i=0;i<(int)a.length();i++) { if(a[i]=='O') sum+=++cnt; else cnt=0; } cout<<sum<<endl; } return 0; }
相关文章推荐
- 逻辑回归
- leetcode 110. Balanced Binary Tree-平衡二叉树|深度遍历
- 《LeetBook》leetcode题解(4): Median of Two Sorted Arrays[H]——两个有序数组中值问题
- CentOS 7.0 关闭防火墙和selinux
- matrix(No.1)operations
- synchronized的使用总结
- 《LeetBook》leetcode题解(4): Median of Two Sorted Arrays[H]——两个有序数组中值问题
- HDU 1074
- DeepLearning(Bengio,ch4)-数值计算
- MVC传值——Controller向View传值(一)
- 在非anctivity类中使用Toast
- 开车
- uva 1586 Molar mass
- 数据结构学习笔记(六)堆-优先队列
- 分析exec*函数对应的系统调用处理过程
- 拟牛顿法及其相关解法
- 模板1
- 数据结构课程上机实验题(三)
- uva 1225 Digit Counting
- uva 455 Periodic Strings