简历:The Google Resume: How to Prepare for a Career and Land a Job at Apple, Microsoft, Google, or any Top Tech Company
算法学习书籍:Introduction to Algorithms
编程珠玑:Programming Pearls (2nd Edition)
C++ 学习:The C++ Programming Language, 4th Edition
经典操作系统书籍,龙书:Operating System Concepts
创业:The Start-up of You: Adapt to the Future, Invest in Yourself, and Transform Your Career
The count-and-say sequence is the sequence of integers beginning as follows:
1, 11, 21, 1211, 111221, ...
1
is read off as "one 1"
or 11
.11
is read off as "two 1s"
or 21
.21
is read off as "one 2
, then one 1"
or 1211
.
Given an integer n, generate the nth sequence.
Note: The sequence of integers will be represented as a string.
就是string的操作,那个tmp string做中间记录,一个n用于数,还有count,思路不难,要注意的就是string的操作,这里
str.append(str, char)是不行的,char不能append到string上,因为string 是const,而char是variable, append只能
用于string之间,而char添加直接用 str = str + char 加号就行了。
换上自己风格的代码看上去就是舒服些。。。
换上自己风格的代码看上去就是舒服些。。。
No comments:
Post a Comment