class Solution { public: int NumberOf1Between1AndN_Solution(int n) { long base=1; long res=0; while(base<=n){ long cur=(n/base)%10; long low=n%base; long high=n/base/10; if (cur>1) { res+=(high+1)*base; }else if(cur==1){ res+=(high*base)+(1+low); }else { res+=high*base; } base=base*10; } retur...