我的代码,没开通博客,没法发题解。
有大佬能帮帮忙吗?
#include <iostream>
using namespace std;
int n,ans;
void dfs(long long x,int w3,int w5,int w7)
{
if (x > n) return;
if (x <= n && w3 && w5 && w7) ans++;
dfs(x*10+3,w3+1,w5,w7);
dfs(x*10+5,w3,w5+1,w7);
dfs(x*10+7,w3,w5,w7+1);
}
int main()
{
cin >> n;
dfs(0,0,0,0);
cout << ans << endl;
return 0;
}