不知道该怎么解释这道题,反正我不太会,感觉很帅
题意:
Code:
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int mxn=2e3+10;
const int mxe=2e5+10;
const int mod=1e9+7;
const int Inf=1e18;
int N;
void solve(){
cin>>N;
int w=1000;
int ans=0;
while(w<=N){
ans+=N-w+1;
w*=1000;
}
cout<<ans<<'\n';
}
signed main(){
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
int __=1;//cin>>__;
while(__--)solve();return 0;
}