简单模拟
原题
#include<bits/stdc++.h>
using namespace std;
const int N = 1e4 + 10;
int n;
int ans;
int main()
{
cin>>n;
for(int i = 1; i <= n; ++ i){
int m = i;
while(m){
int k = m % 10;
if(k == 1 || k == 2 || k == 9 || k == 0){
ans += i;
break;
}
m /= 10;
}
}
cout<<ans<<endl;
return 0;
}