//============================================================================
// Name : hello.cpp
// Author : key
// Version : ∞
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;
//POJ 3438
char str[1010];
int main()
{
int temp;
char *p;
char pre;
int t;
scanf("%d",&t);
while(t--&&scanf("%s",str)!=EOF)
{
pre = '0';
p=str;
temp = 0;
while(1)
{
if(*p != pre)
{
if(temp!=0)
printf("%d%c",temp,pre);
pre = *p;
temp = 1;
}
else
temp++;
if(!(*p))
break;
p++;
}
printf("\n");
}
return 0;
}
POJ 3438 Look and Say
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
POJ 1220 NUMBER BASE CONVERSION
jw72jw
2020-02-23 22:41:59
POJ 1589 Unix ls
jw72jw
2020-02-23 22:41:59
Uva10881 Piotr's Ants
NaCl__
2020-02-23 08:30:43
CodeForces 868B Race Against Time
15zhazhahe
2020-02-21 11:01:05
關於AC自動機fail指針的靈感
jw72jw
2020-07-07 00:34:16
Codeforces 665E Beautiful Subarrays【01trie樹】
Tuesday..
2020-06-24 04:36:42
POJ3461 字符串之模式匹配,kmp,求目標串中有多少個位置可重疊的子串
嚜寒
2020-02-25 22:54:51
POJ3080 基本字符串庫函數的應用 ..Brute Force/樸素模式匹配算法
嚜寒
2020-02-25 22:54:51
POJ 2418 Hardwood Species
jw72jw
2020-02-23 22:41:59
CodeForces 868A Bark to Unlock
15zhazhahe
2020-02-21 11:01:06
acm 平均績點
問題 I : 平均績點 時間限制:1 秒內存限制:32 兆特殊判題: 否 提交:38解決: 8 標籤 簡單模擬 題目描述 每門課的成績分爲A、B、C
疯狂的acmer
2020-06-26 03:03:24
關於AC自動機fail指針的靈感
jw72jw
2020-07-07 00:34:16
Codeforces 665E Beautiful Subarrays【01trie樹】
Tuesday..
2020-06-24 04:36:42
POJ3461 字符串之模式匹配,kmp,求目標串中有多少個位置可重疊的子串
嚜寒
2020-02-25 22:54:51
POJ3080 基本字符串庫函數的應用 ..Brute Force/樸素模式匹配算法
嚜寒
2020-02-25 22:54:51