#include<iostream> #include<cstdio> #include<stdlib.h> using namespace std; int main() { freopen("rand.txt","r",stdin); freopen("xuduoshudeyi.out","w",stdout); int n,count=0,x; scanf("%d",&n); for(int i=1;i<=n;++i) { scanf("%d",&x); for(int j=1;j<=x;++j) { int k=j; while(k>0) { if(k%10==1) count+=1; k/=10; } } } printf("%d",count); fclose(stdin); fclose(stdout); system("xuduoshudeyi.out"); return 0; }
输入样例
12 2462 7740 7040 7260 9142 491 5645 7314 4341 1401 3743 7610
输出样例
30236