Look and say 源码分析
来源:互联网 发布:域名cname 编辑:程序博客网 时间:2024/05/17 06:28
Look and say 源码分析:
- #include <iostream>
- #include <fstream>
- #include <string>
- // each subsequent element is defined from the
- //previous one by "verbally"
- //For exam the string 122344111 can be descibled as
- //"one 1,twp 2,one 1,one 3,twp 4,three 1.
- using namespace std;
- int main(int argc,char *argv[])
- {
- //ifstream cin("aaa.txt");
- string s,t;
- int n;
- cin>>n;
- for(int i=0;i<n ;i++)
- {
- cin>>s;
- int c=0;
- t=s[0];
- int temp =0;
- for(int j=0;j<s.size();j++)
- {
- if(s[j]==t[0])
- {
- temp++;
- if(j==s.size()-1)
- {
- printf("%d%c",temp,t[0]);
- }
- }
- else
- {
- printf("%d%c",temp,t[0]);
- t[0]=s[j];
- temp =1 ;
- if(j==s.size()-1)
- {
- printf("%d%c",temp,t[0]);
- }
- }
- }
- cout<<endl;
- }
- return 0;
- }
- Look and say 源码分析
- LOOK AND SAY
- 3438 Look and Say
- poj3438 Look and Say
- Look and Say-3438
- POJ3438-Look and Say
- PKU 3438 look and say
- sicily 1491 Look and Say
- POJ 3438 Look and Say
- zoj 2886 Look and Say
- HOJ 2603 Look and Say
- poj--3438--LOOK and SAY
- ZOJ 2886 Look and Say
- ZOJ 2886 Look and Say
- Sicily 1491 Look and Say
- hoj 2603 Look and Say
- POJ 3438:Look and Say
- I00031 Look-and-say sequence
- 一些话
- 最简单 的 加密算法
- JSP内置对象(9个常用的内置对象)
- 第一次来到这里,感觉真好
- First
- Look and say 源码分析
- Oracle 表管理
- Oracle查询案例.txt
- c语言
- 稀里糊涂
- 通俗易懂论同步与异步
- Android的OpenGL学习笔记(5)
- Hello
- 数据结构