题目描述

题目分析
简单枚举每一个可行的数
cpp
#include<bits/stdc++.h>
using namespace std;
int flag, ans;
int main()
{
int n;
cin >> n;
for(int i = 1; i <= n; i ++)
{
flag = 0;
int x = i;
while(x)
{
int y = x % 10;
if(y == 2 || y == 0 || y == 1 || y == 9)flag = 1;
x /= 10;
}
if(flag)ans += i;
}
cout << ans;
return 0;
}