Language: C++

#include <bits/stdc++.h>
using namespace std;
int n =1e9,c=0;
set<int> st;
int a[3]={3,5,7};
int b[4]={3,3,5,7};
int c[4]={3,5,5,7};
int d[4]={3,5,7,7};
int main(){
	int x;
	cin>>x;
	do{
		st.insert(a[0]*100+a[1]*10+a[2]);
	}while(next_permutation(a,a+3));
	do{
		st.insert(b[0]*1000+b[1]*100+b[2]*10+b[3]);
	}while(next_permutation(b,b+4));
	do{
		st.insert(c[0]*1000+c[1]*100+c[2]*10+c[3]);
	}while(next_permutation(c,c+4));
	do{
		st.insert(d[0]*1000+d[1]*100+d[2]*10+d[3]);
	}while(next_permutation(d,d+4));
	for(set<int>::iterator it=st.begin();it!=st.end();it++){
		if(*it<x) c++;
	}	
	printf("%d",c);
	return 0;
}

Compiler output:
a.cc:7:5: error: conflicting declaration 'int c [4]'
    7 | int c[4]={3,5,5,7};
      |     ^
a.cc:3:12: note: previous declaration as 'int c'
    3 | int n =1e9,c=0;
      |            ^
a.cc: In function 'int main()':
a.cc:19:28: error: invalid types 'int[int]' for array subscript
   19 |                 st.insert(c[0]*1000+c[1]*100+c[2]*10+c[3]);
      |                            ^
a.cc:19:38: error: invalid types 'int[int]' for array subscript
   19 |                 st.insert(c[0]*1000+c[1]*100+c[2]*10+c[3]);
      |                                      ^
a.cc:19:47: error: invalid types 'int[int]' for array subscript
   19 |                 st.insert(c[0]*1000+c[1]*100+c[2]*10+c[3]);
      |                                               ^
a.cc:19:55: error: invalid types 'int[int]' for array subscript
   19 |                 st.insert(c[0]*1000+c[1]*100+c[2]*10+c[3]);
      |                                                       ^
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of 'bool std::__next_permutation(_BidirectionalIterator, _BidirectionalIterator, _Compare) [with _BidirectionalIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]':
/usr/include/c++/14/bits/stl_algo.h:2951:2:   required from 'bool std::next_permutation(_BIter, _BIter) [with _BIter = int]'
 2950 |       return std::__next_permutation
      |              ~~~~~~~~~~~~~~~~~~~~~~~
 2951 |         (__first, __last, __gnu_cxx::__ops::__iter_less_iter());
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:20:25:   required from here
   20 |         }while(next_permutation(c,c+4));
      |                ~~~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2912:54: error: no matching function for call to '__iterator_category(int&)'
 2912 |                              std::__iterator_category(__first));
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:65,
                 from /usr/include/c++/14/algorithm:60:
/usr/include/c++/14/bits/stl_iterator_base_types.h:239:5: note: candidate: 'template<class _Iter> constexpr typename std::iterator_traits< <template-parameter-1-1> >::iterator_category std::__iterator_category(const _Iter&)'
  239 |     __iterator_category(const _Iter&)
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:239:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_iterator_base_types.h: In substitution of 'template<class _Iter> constexpr typename std::iterator_traits< <template-parameter-1-1> >::iterator_category std::__iterator_category(const _Iter&) [with _Iter = int]':
/usr/include/c++/14/bits/stl_algo.h:2912:33:   required from 'bool std::__next_permutation(_BidirectionalIterator, _BidirectionalIterator, _Compare) [with _BidirectionalIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
 2912 |                              std::__iterator_category(__first));
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2951:2:   required from 'bool std::next_permutation(_BIter, _BIter) [with _BIter = int]'
 2950 |       return std::__next_permutation
      |              ~~~~~~~~~~~~~~~~~~~~~~~
 2951 |         (__first, __last, __gnu_cxx::__ops::__iter_less_iter());
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:20:25:   required from here
   20 |         }while(next_permutation(c,c+4));
      |                ~~~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:239:5: error: no type named 'iterator_category' in 'struct std::iterator_traits<int>'
  239 |     __iterator_category(const _Iter&)
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h: In instantiation of 'bool std::__next_permutation(_BidirectionalIterator, _BidirectionalIterator, _Compare) [with _BidirectionalIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]':
/usr/include/c++/14/bits/stl_algo.h:2951:2:   required from 'bool std::next_permutation(_BIter, _BIter) [with _BIter = int]'
 2950 |       return std::__next_permutation
      |              ~~~~~~~~~~~~~~~~~~~~~~~
 2951 |         (__first, __last, __gnu_cxx::__ops::__iter_less_iter());
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:20:25:   required from here
   20 |         }while(next_permutation(c,c+4));
      |                ~~~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2918:54: error: no matching function for call to '__iterator_category(int&)'
 2918 |                              std::__iterator_category(__first));
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:239:5: note: candidate: 'template<class _Iter> constexpr typename std::iterator_traits< <template-parameter-1-1> >::iterator_category std::__iterator_category(const _Iter&)'
  239 |     __iterator_category(const _Iter&)
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:239:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_iterator_base_types.h: In substitution of 'template<class _Iter> constexpr typename std::iterator_traits< <template-parameter-1-1> >::iterator_category std::__iterator_category(const _Iter&) [with _Iter = int]':
/usr/include/c++/14/bits/stl_algo.h:2918:33:   required from 'bool std::__next_permutation(_BidirectionalIterator, _BidirectionalIterator, _Compare) [with _BidirectionalIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
 2918 |                              std::__iterator_category(__first));
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2951:2:   required from 'bool std::next_permutation(_BIter, _BIter) [with _BIter = int]'
 2950 |       return std::__next_permutation
      |              ~~~~~~~~~~~~~~~~~~~~~~~
 2951 |         (__first, __last, __gnu_cxx::__ops::__iter_less_iter());
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:20:25:   required from here
   20 |         }while(next_permutation(c,c+4));
      |                ~~~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:239:5: error: no type named 'iterator_category' in 'struct std::iterator_traits<int>'
  239 |     __iterator_category(const _Iter&)
      |     ^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:71:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_less_iter::operator()(_Iterator1, _Iterator2) const [with _Iterator1 = int; _Iterator2 = int]':
/usr/include/c++/14/bits/stl_algo.h:2905:14:   required from 'bool std::__next_permutation(_BidirectionalIterator, _BidirectionalIterator, _Compare) [with _BidirectionalIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
 2905 |           if (__comp(__i, __ii))
      |               ~~~~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2951:2:   required from 'bool std::next_permutation(_BIter, _BIter) [with _BIter = int]'
 2950 |       return std::__next_permutation
      |              ~~~~~~~~~~~~~~~~~~~~~~~
 2951 |         (__first, __last, __gnu_cxx::__ops::__iter_less_iter());
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:20:25:   required from here
   20 |         }while(next_permutation(c,c+4));
      |                ~~~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:45:16: error: invalid type argument of unary '*' (have 'int')
   45 |       { return *__it1 < *__it2; }
      |                ^~~~~~
/usr/include/c++/14/bits/predefined_ops.h:45:25: error: invalid type argument of unary '*' (have 'int')
   45 |       { return *__it1 < *__it2; }
      |                         ^~~~~~
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = int; _ForwardIterator2 = int]':
/usr/include/c++/14/bits/stl_algo.h:2910:22:   required from 'bool std::__next_permutation(_BidirectionalIterator, _BidirectionalIterator, _Compare) [with _BidirectionalIterator = int; _Compare = __gnu_cxx::__ops::_Iter_less_iter]'
 2910 |               std::iter_swap(__i, __j);
      |               ~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:2951:2:   required from 'bool std::next_permutation(_BIter, _BIter) [with _BIter = int]'
 2950 |       return std::__next_permutation
      |              ~~~~~~~~~~~~~~~~~~~~~~~
 2951 |         (__first, __last, __gnu_cxx::__ops::__iter_less_iter());
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:20:25:   required from here
   20 |         }while(next_permutation(c,c+4));
      |                ~~~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:185:12: error: invalid type argument of unary '*' (have 'int')
  185 |       swap(*__a, *__b);
      |            ^~~~
/usr/include/c++/14/bits/stl_algobase.h:185:18: error: invalid type argument of unary '*' (have 'int')
  185 |       swap(*__a, *__b);
      |                  ^~~~