hdu1020--Encoding HDU(133)
2013-09-02 18:01
260 查看
【题目】点击打开链接
【题解】简单问题,不过需要注意题意说的是连续相同的字母!!!
【题解】简单问题,不过需要注意题意说的是连续相同的字母!!!
#pragma warning(disable:4786) #include<iostream> #include<algorithm> #include<cmath> #include<stdio.h> #include<time.h> #include<stdlib.h> #include<queue> #include<set> #include<vector> #include<string> #include<ctime> #include<string.h> using namespace std; #define pi acos(-1.0) //#define LL __int64 typedef long long LL; #define INF 0x7fffffffffffffff #define bug puts("hear!") #define inf 0x7fffffff #define eps 1e-10 #define FRE freopen("in.txt","r",stdin) #define E exp(1.0) #define mod 1000000007 char str[10005]; int main () { int t ; while( scanf("%d" , &t ) != EOF ) { while( t-- ) { scanf("%s" , str); int len = strlen ( str ); for( int i = 0 ; i < len ; i++ ) { int hh = 1 ; for( int j = i+1 ; j < len ; j++ ) if( str[i] == str[j] )hh++; else break; if( hh > 1 ) printf("%d%c", hh , str[i] ); else printf("%c" , str[i]); i +=(hh-1); } puts(""); } } return 0; }
相关文章推荐
- hdu_1020_Encoding_201310172120
- hdu 1020 找规律
- HDU 1020 Encoding
- HDU1020 - Encoding (模拟)
- hdu 1020 Encoding
- HDU 1020 Encoding
- HDU-1020-Encoding
- HDU1020--- 编码
- HDU-1020-Encoding,题意不清,其实很水~~
- HDU 1020
- hdu 1020 Encoding【字符串处理】
- HDU 1020 Encoding
- HDU 1020 — Encoding
- HDU 1020 Encoding
- HDU-1020-Encoding(Java && 弱水三千)
- HDU 1020 Encoding
- hdu 1020 Encoding
- hdu1020 Encoding
- HDU1020
- hdu 1020 简单的字符串处理