@@ -0,0 +1,1320 @@
+%0A/**%0A * The count-and-say sequence is the sequence of integers beginning as follows:%0A   1, 11, 21, 1211, 111221, ...%0A%0A * 1 is read off as %22one 1%22 or 11.%0A * 11 is read off as %22two 1s%22 or 21.%0A * 21 is read off as %22one 2, then one 1%22 or 1211.%0A * Given an integer n, generate the nth sequence.%0A%0A * Note: The sequence of integers will be represented as a string.%0A * Note: brute way: loop string%0A * @author chenshuna%0A *%0A */%0A%0Apublic class countAndSay %7B%0A    public static String countAndSay(int n) %7B%0A        String restult = %221%22;%0A        for(int i=1;i%3Cn;i++)%7B%0A            restult = countAndSayArray(restult);%0A        %7D%0A        return restult;%0A    %7D%0A     public static String countAndSayArray(String cas) %7B%0A         int n = cas.length();%0A         int count = 1;%0A         int point = 0;%0A         StringBuilder res = new StringBuilder();%0A         while(point %3C n)%7B%0A             while((point+count) %3C n && cas.charAt(point) == cas.charAt(point+count))%7B%0A                 count++;%0A             %7D%0A             res.append(count + %22%22);%0A             res.append(cas.charAt(point) + %22%22);%0A             point = point + count;%0A             count = 1;%0A         %7D%0A         %0A         return res.toString();%0A         %0A     %7D%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09System.out.print(countAndSay(4));%0A%09%7D%0A%0A%7D%0A

Rename CountAndSay.java to CountAndSay_38.java