提交时间:2021-12-22 21:37:22

运行 ID: 27995

#include<bits/stdc++.h> using namespace std; int n,a[10000],b,ans; int main(){ cin>>n; for(int i=0;i<=n;i++){ a[i]+=b; b++; while(a[i]!=0){ if(a[i]%10==1){ ans++; a[i]/=10; }else{ a[i]/=10; } } } cout<<ans; return 0; }