比如n=11的意思,那么map应该有0-1, 1-4, 2-1, 3-1, 4-1, 5-1, 6-1, 7-1, 8-1, 9 -1
public void countDigits(int n, Map map) {
while (n != 0) {
int d = n%10;
n /= 10;
map.put(d,map.get(d)++);
}
return result;
}
除上述方法外。我想得到从 1 到 N 的所有数字。