POJ 3438 Look and Say
来源:互联网 发布:adobe音乐编辑软件 编辑:程序博客网 时间:2024/05/21 09:00
//============================================================================
// 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;
}
// 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--3438--LOOK and SAY
- POJ 3438:Look and Say
- POJ 3438 Look and Say (水题)
- POJ 3438 Look and Say(水题)
- POJ 3438 Look and Say(水~)
- POJ 3438 Look and Say G++
- 3438 Look and Say
- Look and Say-3438
- PKU 3438 look and say
- LOOK AND SAY
- poj3438 Look and Say
- POJ3438-Look and Say
- sicily 1491 Look and Say
- Look and say 源码分析
- zoj 2886 Look and Say
- HOJ 2603 Look and Say
- ZOJ 2886 Look and Say
- 在Mac OS X中配置Apache + PHP + MySQL
- POJ 3398 Perfect Service
- 现代数据库管理学习笔记一 数据库管理语境
- 安装 Mplayer SMplayer 视频播放器的最好的方法(ubuntu使用之五)---...
- Serial UART information
- POJ 3438 Look and Say
- ubuntu中文输入法配置及简单显卡驱动安装
- Android开发之旅: Intents和Intent Filters(理论部分)
- 2011.08.07
- POJ 3659 Cell Phone Network
- RS422 serial information
- 将一个数组中的每一个元素初始化为0
- POJ 1141 Brackets Sequence
- Android中使用SAX方式解析XML文件