究极暴力打表代码
#include<stdio.h>
int main()
{
long long n,s=0;
while(~scanf("%lld",&n))
{
if(n<10)
s=n;
if(n>=10&&n<100)
s=2n-9;
if(n>=100&&n<1000)
s=3n-9-99;
if(n>=1000&&n<10000)
s=4n-9-99-999;
if(n>=10000&&n<100000)
s=5n-9-99-999-9999;
if(n>=100000&&n<1000000)
s=6n-9-99-999-9999-99999;
if(n>=1000000&&n<10000000)
s=7n-9-99-999-9999-99999-999999;
if(n>=10000000&&n<100000000)
s=8n-9-99-999-9999-99999-999999-9999999;
if(n>=100000000&&n<1000000000)
s=n9-9-99-999-9999-99999-999999-9999999-99999999;
if(n>=1000000000&&n<10000000000)
s=10n-9-99-999-9999-99999-999999-9999999-99999999-999999999;
if(n>=10000000000&&n<100000000000)
s=11n-9-99-999-9999-99999-999999-9999999-99999999-999999999-9999999999;
if(n>=100000000000&&n<1000000000000)
s=12n-9-99-999-9999-99999-999999-9999999-99999999-999999999-9999999999-99999999999;
if(n>=1000000000000&&n<10000000000000)
s=13n-9-99-999-9999-99999-999999-9999999-99999999-999999999-9999999999-99999999999-999999999999;
if(n>=10000000000000&&n<100000000000000)
s=14n-9-99-999-9999-99999-999999-9999999-99999999-999999999-9999999999-99999999999-999999999999-9999999999999;
printf("%lld\n",s);
}
}***