UVA 1585 Score
来源:互联网 发布:文华财经mac版 编辑:程序博客网 时间:2024/06/05 02:04
这道题大水题啊!!!其实我想一边读字符一边处理的,但是太久没单纯的用C语言了,所以对用getchar处理空格和换行心怀敬畏。。。
直接贴代码:
#include <iostream>using namespace std;int main(){ string line; int t, score; cin >> t; while(t--) { cin >> line; int len, flag = 0; len = line.size(); score = 0; for(int i = 0; i < len; i++) { if(line[i] == 'X') { flag = 0; } else { score += (++flag); } } cout << score << endl; } return 0;}
阅读全文
0 0
- UVa 1585 Score
- uva 1585 - Score
- UVa 1585 - Score
- UVa 1585 - Score
- UVA 1585 - Score
- UVa 1585 - Score
- UVa 1585 - Score
- Uva 1585 Score
- UVa 1585 - Score
- UVa 1585 - Score
- UVa-1585Score
- 【Uva 1585】 Score
- UVA - 1585 Score
- Uva - 1585 - Score
- UVa 1585 - Score
- Uva 1585 score
- UVa 1585 Score
- UVA 1585 Score
- 初识vscode,留下点设置及初步插件
- ThreadLocal使用及原理
- JSON基础
- 基本内置类型
- Python 中 map和reduce 的用法
- UVA 1585 Score
- (hdu1257)最少拦截系统(DP)
- B
- Linux编程学习之进程间通信篇-无名管道
- 批处理脚本bat设置IP地址
- 学习曲线
- Centos7下安装MySQL-5.7.15
- CSS基础(二) 个人笔记
- C语言里面的指针问题