习题3-1 score
来源:互联网 发布:怎么做seo 编辑:程序博客网 时间:2024/06/16 11:31
#include <stdio.h>#include <string.h>#define maxn 81char s[maxn];int main(){ //input n int n=0; scanf("%d",&n); //input n times for(int i=0;i<n;i++) { scanf("%s",s); int len=strlen(s); //printf("%d",len); /* * for(int i=0;i<len;i++) * printf("%c",s[i]); */ //连续出现O的计算 int tempscore=0;//当前连续O数(不算当前这个数) int totalcount=0; for(int i=0;i<len;i++) { if(s[i]=='O')//连续第一个O { tempscore++; totalcount+=tempscore; } if(s[i]=='X') { tempscore=0; } } printf("%d\n",totalcount); }}
0 0
- 习题3-1 score
- 习题3-1 得分(Score)
- 【习题3-1】 UVA - 1585 Score
- UVa 1585 Score(习题3-1)
- 小紫书 习题 3-1(UVA 1585) 得分(Score)
- 习题3_1得分(Score)
- 算法竞赛入门经典(第2版)习题3-1 得分 Score UVa1585
- 《算法竞赛入门经典2ndEdition 》习题3-1 得分(Score, Uva1585)
- 习题3-1 得分(Score, ACM/ICPC Seoul 2005, UVa 1585)
- 3-1 Score(P57) / UVA 1585
- Score
- score
- score
- Score
- Score
- Score
- Score
- 算法入门经典第二版 3-1 Score
- 面试题38:数字在排序数组中出现的次数
- 选项卡的实现方式
- poj 1094 Sorting It All Out (拓扑排序)@
- 有关error: “IDD_DIALOG2”: 未声明的标识符类似错误解决方法转载
- 排序——堆排序
- 习题3-1 score
- ListView 自动向下滑动
- 单链表是否有环--Java
- 二叉树--九度.1201.[二叉排序树]
- KMP算法
- All in All UVA
- pat-top 1006. Tree Traversals
- android UI开发之RecyclerView(一)简单实现
- 算法设计与应用基础: 第二周(1)