Language: C++

#include <bits/stdc++.h>
using ll = long long int;
int INF = 1e9+7;
int N;
bool check(int n) {
    string s = to_string(n);
    return (s.find('3') != string::npos &&
            s.find('5') != string::npos &&
            s.find('7') != string::npos);
}
int dfs(int n) {
    if (n > N) return 0;
    int res = 0;
    if (check(n)) res = 1;

    res += dfs(n*10 + 3);
    res += dfs(n*10 + 5);
    res += dfs(n*10 + 7);
    return res;
}

int main() {
    cin >> N;
    cout << dfs(0) << endl;
}


Compiler output:
a.cc: In function 'bool check(int)':
a.cc:6:5: error: 'string' was not declared in this scope
    6 |     string s = to_string(n);
      |     ^~~~~~
a.cc:6:5: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:13: error: 's' was not declared in this scope
    7 |     return (s.find('3') != string::npos &&
      |             ^
a.cc:7:28: error: 'string' is not a class, namespace, or enumeration
    7 |     return (s.find('3') != string::npos &&
      |                            ^~~~~~
a.cc:8:28: error: 'string' is not a class, namespace, or enumeration
    8 |             s.find('5') != string::npos &&
      |                            ^~~~~~
a.cc:9:28: error: 'string' is not a class, namespace, or enumeration
    9 |             s.find('7') != string::npos);
      |                            ^~~~~~
a.cc: In function 'int main()':
a.cc:23:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   23 |     cin >> N;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:24:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   24 |     cout << dfs(0) << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:24:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   24 |     cout << dfs(0) << endl;
      |                       ^~~~
      |                       std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~