POJ 3438 Look and Say(水题)
来源:互联网 发布:卡片制作软件 编辑:程序博客网 时间:2024/06/06 02:27
【题意简述】:就是说一串数字,现在让我们换一种方式去描述它,用该数字的个数和数字本身去重新描述这串数字。
【分析】:简单模拟一下。
//248k 641ms#include<iostream>using namespace std;int main(){int t;char digits[1001];cin>>t;while(t--){cin>>digits;int len = strlen(digits);int count = 1;for(int i = 0;i<len;i++){if(digits[i] == digits[i+1])count++;else{cout<<count<<digits[i];count = 1;}}cout<<endl;}return 0;}
0 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
- POJ 3438 Look and Say(我的水题之路——N个M的队列)
- 外观数列(Look-and-say sequence)
- LOOK AND SAY
- poj3438 Look and Say
- POJ3438-Look and Say
- sicily 1491 Look and Say
- Look and say 源码分析
- zoj 2886 Look and Say
- 面试碰到的题——C++基础概念
- Samba的配置问题
- android loader
- Android 四大组件
- OpenCV学习笔记(1)——显示图片
- POJ 3438 Look and Say(水题)
- HttpWatch工具简介及使用技巧(转载)
- 汉诺塔(河内塔)问题
- UVA - 442 Matrix Chain Multiplication
- serialVersionUID作用
- 设计模式: 观察者模式
- 用impdp导dmp文件
- C++ STL Stack 快速入门
- ScheduledExecutorService定时周期执行指定的任务