Codeforces Round #308 (Div. 2) Vanya and Books

题目链接: 题意:就是求有几个数字; eg:13:1 2 3 4 5 6 4 7 8 9 1 0 1 1 1 2 1 3 一共17个数字

;long long a[12]={0,9,99,999,9999,99999,999999,9999999,99999999,999999999,9999999999};int main(){long long m;while(cin>>m){(m<10){cout<<m<<endl;continue;}else{for(int i=1; i<=10; i++){k*=10;if(m<k){sum+=(m-k/10+1)*i;break;}elsesum+=(a[i]-a[i-1])*i;}cout<<sum<<endl;}}return 0;}

,灯红酒绿的城市,登上楼顶,俯视万家灯火,

Codeforces Round #308 (Div. 2) Vanya and Books

相关文章:

你感兴趣的文章:

标签云: