Language: C++

#include<bits/stdc++.h> 
using namespace std; 
#define ll long long int
#define v vector<ll>
#define vv vector<v>
#define MAX 15000001
#define p pair<int,int>
#define speed ios::sync_with_stdio(false); cin.tie(0) ; cout.tie(0)

ll pow2[15];
ll pow3[15];
ll pow10[15];
int len;
ll ans[10];
vector<int> numbers[11];

void generate()
{
	numbers[1].push_back(3);
	numbers[1].push_back(5);
	numbers[1].push_back(7);
	for(int i=2;i<10;i++)
	{
		for(int j=0;j<numbers[i-1].size();j++)
		{
			int curr=numbers[i-1][j];
			numbers[i].push_back(curr*10 +3);
			numbers[i].push_back(curr*10 +5);
			numbers[i].push_back(curr*10 +7);
		}
	}
}
bool check(int x)
{
	//vector<int> vec;
	int a=0,b=0,c=0;
	while(x!=0)
	{
		int curr=x%10;
		if(curr==3)
			a=1;
		if(curr==5)
			b=1;
		if(curr==7)
			c=1;
		x/=10;
	}
	return a && b && c;
}

int main()
{
	int n;
	cin>>n;
	pow2[0]=pow3[0]=pow10[0]=1;
	for(int i=0;i<15;i++)
	{
		pow3[i+1]=pow3[i]*3;
		pow2[i+1]=pow2[i]*2;
		pow10[i+1]=pow10[i]*10;
	}
	for(int i=1;i<=10;i++)
	{
		ans[i]+=ans[i-1];
		ans[i]+=pow3[i] - 3*pow2[i] + 3;
	//	cout<<ans[i]<<endl;
	}
	len=0;
	for(int i=1;i<11;i++)
	{
		if((int)n/(pow10[i]) ==0)
		{
			len=i;
			break;
		}
	}
	//cout<<len;
	int res=0;
	res=ans[len-1];
	if(len>=3)
	{
		generate();
		for(int i=0;i<numbers[len].size();i++)
		{
			int num=numbers[len][i];
			if(num<= n && check(num))
				res++;
		}
	}#include<bits/stdc++.h> 
using namespace std; 
#define ll long long int
#define v vector<ll>
#define vv vector<v>
#define MAX 15000001
#define p pair<int,int>
#define speed ios::sync_with_stdio(false); cin.tie(0) ; cout.tie(0)

ll pow2[15];
ll pow3[15];
//ll pow10[15];
int len;
ll ans[10];
vector<int> numbers[11];

void generate()
{
	numbers[1].push_back(3);
	numbers[1].push_back(5);
	numbers[1].push_back(7);
	for(int i=2;i<10;i++)
	{
		for(int j=0;j<numbers[i-1].size();j++)
		{
			int curr=numbers[i-1][j];
			numbers[i].push_back(curr*10 +3);
			numbers[i].push_back(curr*10 +5);
			numbers[i].push_back(curr*10 +7);
		}
	}
}
bool check(int x)
{
	//vector<int> vec;
	int a=0,b=0,c=0;
	while(x!=0)
	{
		int curr=x%10;
		if(curr==3)
			a=1;
		if(curr==5)
			b=1;
		if(curr==7)
			c=1;
		x/=10;
	}
	return a && b && c;
}

int main()
{
	int n;
	cin>>n;
	pow2[0]=pow3[0]=1;
	for(int i=0;i<15;i++)
	{
		pow3[i+1]=pow3[i]*3;
		pow2[i+1]=pow2[i]*2;
		//pow10[i+1]=pow10[i]*10;
	}
	for(int i=1;i<=10;i++)
	{
		ans[i]+=ans[i-1];
		ans[i]+=pow3[i] - 3*pow2[i] + 3;
	//	cout<<ans[i]<<endl;
	}
	len=0;
	int t=n;
	while(t!=0)
	{
		len++;
		t/=10;
	}
	//cout<<len;
	int res=0;
	res=ans[len-1];
	if(len>=3)
	{
		generate();
		for(int i=0;i<numbers[len].size();i++)
		{
			int num=numbers[len][i];
			if(num<= n && check(num))
				res++;
		}
	}
	cout<<res;
}
	cout<<res;
}

Compiler output:
a.cc:89:10: error: stray '#' in program
   89 |         }#include<bits/stdc++.h>
      |          ^
a.cc:12:4: warning: built-in function 'pow10' declared as non-function [-Wbuiltin-declaration-mismatch]
   12 | ll pow10[15];
      |    ^~~~~
a.cc: In function 'int main()':
a.cc:89:11: error: 'include' was not declared in this scope
   89 |         }#include<bits/stdc++.h>
      |           ^~~~~~~
a.cc:89:19: error: 'bits' was not declared in this scope
   89 |         }#include<bits/stdc++.h>
      |                   ^~~~
a.cc:89:24: error: 'stdc' was not declared in this scope; did you mean 'std'?
   89 |         }#include<bits/stdc++.h>
      |                        ^~~~
      |                        std
a.cc:90:1: error: expected primary-expression before 'using'
   90 | using namespace std;
      | ^~~~~
a.cc:106:1: error: a function-definition is not allowed here before '{' token
  106 | {
      | ^
a.cc:122:1: error: a function-definition is not allowed here before '{' token
  122 | {
      | ^
a.cc:139:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
  139 | int main()
      |         ^~
a.cc:139:9: note: remove parentheses to default-initialize a variable
  139 | int main()
      |         ^~
      |         --
a.cc:139:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:140:1: error: a function-definition is not allowed here before '{' token
  140 | {
      | ^