https://www.acmicpc.net/problem/1748
#include<stdio.h>
#include <string.h>
static int zero(int n){
int z=1;
if(n<=0) z=0;
else{
for(int i=1;i<=n-1;i++){
z*=10;
}
}
return z;
}
int main() {
int n;
scanf("%d",&n);
char k[15];
sprintf(k,"%d",n);
int len=strlen(k);
int count=10;
int num=0;
while(n>0){
num+=(n-zero(len)+1)*len;
n=zero(len)-1;
len--;
}
printf("%d",num);
}