算法入门经典第二版 3-1 Score
来源:互联网 发布:centos升级内核 编辑:程序博客网 时间:2024/05/22 15:48
#include <stdio.h>#include <string.h>int main(){ int T; char s[85]; scanf("%d",&T); while(T--) { scanf("%s",s); int n = strlen(s),score = 0,subscore = 1; if(n < 1 || n > 80) return -1; for(int i = 0; i < n; i++) { if( s[i] == 'X' ) { subscore = 1; continue; } score += subscore; if(s[i+1] == 'O' ) subscore++; } printf("%d\n",score); } return 0;}
阅读全文
0 0
- 算法入门经典第二版 3-1 Score
- 算法竞赛入门经典(第2版)习题3-1 得分 Score UVa1585
- 《算法竞赛入门经典2ndEdition 》习题3-1 得分(Score, Uva1585)
- 算法入门经典第二版 3-3 Digit Counting
- 《算法竞赛入门经典 第二版》 Chapter 3
- 算法入门经典第二版 3-2 Molar Mass
- 算法入门经典第二版 3-4 Periodic Strings
- 算法入门经典第二版 3-5 Puzzle
- 算法入门经典第二版 3-9 All in All
- 算法入门经典第二版 3-8 Repeating Decimals
- 算法入门经典第二版 3-7 DNA Consensus String
- 算法竞赛入门经典 第三章 uVA1585 - Score
- 算法竞赛入门经典第二版 第二章
- UVa1585 得分 算法竞赛入门经典第二版CH-2习题3-1
- 【算法入门经典】 第二章
- 算法入门经典第二版(紫书) 第二章 2-1 -> 2-6
- 算法竞赛入门经典(第二版) 习题训练
- 算法竞赛入门经典第二版的学习
- 淘宝新店铺如何打造爆款
- Docker Compose
- Echarts3.0 实现tooltip自动显示自动播放
- hdu-2203-亲和串(KMP模板)
- Mysql实现企业级数据库主从复制架构实战
- 算法入门经典第二版 3-1 Score
- CodeChef:Skiing(优先队列 & BFS)
- puppet的主要资源解释及示例
- 获取IP
- 如果文件已经出现在了git库里面 但是后续不需要再次追踪的处理
- springMVC为系统添加验证码
- [BZOJ]3262: 陌上花开 CDQ分治+树状数组
- 写冒泡排序可以排序多个字符串
- css中单位px、pt、em和rem的区别