HDOJ 1020 究极水题
2017-12-04 13:58
232 查看
对于这道题我只想说。没理解他在说什么真是个很烦躁的事。 EG:ABBCCCCAAAA——->A2B4C4A
#include <iostream> #include <string.h> using namespace std ; int main(){ int n; cin >> n; while(n--){ string s ; cin >> s; int count = 1 ; char ch = s[0]; for(int i = 1 ; i < s.length() ; i++){ if (s[i] == ch){ count++; } else{ if(count == 1) cout << ch; else cout << count << ch; count = 1; ch = s[i]; } } if(count == 1) cout << ch; else cout << count << ch; cout<<endl; } }
相关文章推荐
- hdoj 1020 Encoding (水题)
- HDOJ-1020 Encoding[水题]
- [水题]HDOJ1020
- hdoj 5578 Friendship of Frog 【水题】
- HDOJ 2161 Primes(水题)
- hdoj 4450 Draw Something 水题
- hdoj 1001 水题坑人 小心
- HDOJ 1032 模拟 水题
- hdoj.2178 猜数字【水题】 2015/03/27
- HDOJ 1285 拓扑排序 水题
- HDOJ2011 ( 多项式求和 )【水题】
- hdoj--1418--抱歉(水题)
- hdoj 2014 青年歌手大奖赛_评委会打分(水题 强制转换数据类型)
- hdoj--幸福指数(水题)
- 水题 hdoj-2006奇数偶数判断小技巧 、 hdoj-2007
- hdoj 1020
- hdoj--2803--The MAX(水题)
- HDOJ 2803 The MAX【水题】
- hdoj 2803 The MAX 【水题】
- ACM水题系列 HDOJ2093