细语呢喃

0%

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 _n_th sequence.

Note: The sequence of integers will be represented as a string. 题目地址：leetcode Count and Say

n=1 返回1

n=2由于n=1的结果为1，有1个1，所以返回11

n=3由于n=2结果为11，有2个1，返回21

n=4由于n=3结果为21，有1个2和1个1，所以返回1211

C++

Python