https://www.cnblogs.com/xuanxufeng/p/6854105.html
#include<iostream>
#include<string.h>
#include<vector>
#include<algorithm>
#include<math.h>
#include<map>
using namespace std;
int NumberOf1Between1AndN_Solution(int n)
{
int ones = 0;
for(long m = 1; m <= n ; m *= 10){
ones += (n/m+8)/10*m+(n/m % 10 == 1?n%m+1:0);
}
return ones;
}
int main(){
int res = NumberOf1Between1AndN_Solution(11);
cout<<res;
return 0;
}