取巧思路,既然数值本身没有意义,那就转成字符串拼接到一起,遍历字符串缺点:虽然思路简单,但时间空间耗费大 public class Solution { static int num = 0; static String s_result; public int NumberOf1Between1AndN_Solution(int n) { //遍历1-n,z转成字符串接到s_result上 for (int i = 0; i <= n; i++) { s_result = s_result + i; ...