Language: C++

include <bits/stdc++.h>
#define rep(i,n) for(long long int i = 0; i < n; i++)
#define _rep(i,m,n) for(long long int i = m; i < n; i++)
#define print(n) std::cout << n << std::endl
#define _print(n) std::cout << n
using namespace std;
typedef long long ll;
const int N = 1000000;
const ll mod = 1000000007;

int main(){
    string num; cin >> num;
    vector<int> a(4);
    rep(i,4){
        a[i] = (int)(num[i] - '0');
    }
    int n = 3;

    for(int bit = 0; bit < (1 << n); ++bit) {
        int sum = 0;

        for (int i = 1; i <= n; i++) {
            if (bit & (1 << i)) {
                sum += a[i];
            } else {
                sum -= a[i];
            }
        }
        if(sum == 7 - a[0]){
            _print(a[0]);
            for (int i = 1; i <= n; i++) {
                if(bit & (1 << i)){
                    _print('+');
                }else{
                    _print('-');
                }
                _print(a[i]);
            }
            print("=7");
            break;
        }
    }
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:12:5: error: 'string' was not declared in this scope
   12 |     string num; cin >> num;
      |     ^~~~~~
a.cc:12:17: error: 'cin' was not declared in this scope
   12 |     string num; cin >> num;
      |                 ^~~
a.cc:12:24: error: 'num' was not declared in this scope; did you mean 'enum'?
   12 |     string num; cin >> num;
      |                        ^~~
      |                        enum
a.cc:13:5: error: 'vector' was not declared in this scope
   13 |     vector<int> a(4);
      |     ^~~~~~
a.cc:13:12: error: expected primary-expression before 'int'
   13 |     vector<int> a(4);
      |            ^~~
a.cc:15:9: error: 'a' was not declared in this scope
   15 |         a[i] = (int)(num[i] - '0');
      |         ^
a.cc:24:24: error: 'a' was not declared in this scope
   24 |                 sum += a[i];
      |                        ^
a.cc:26:24: error: 'a' was not declared in this scope
   26 |                 sum -= a[i];
      |                        ^
a.cc:29:23: error: 'a' was not declared in this scope
   29 |         if(sum == 7 - a[0]){
      |                       ^
a.cc:5:24: error: 'cout' is not a member of 'std'
    5 | #define _print(n) std::cout << n
      |                        ^~~~
a.cc:30:13: note: in expansion of macro '_print'
   30 |             _print(a[0]);
      |             ^~~~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | include <bits/stdc++.h>
a.cc:5:24: error: 'cout' is not a member of 'std'
    5 | #define _print(n) std::cout << n
      |                        ^~~~
a.cc:33:21: note: in expansion of macro '_print'
   33 |                     _print('+');
      |                     ^~~~~~
a.cc:5:24: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #define _print(n) std::cout << n
      |                        ^~~~
a.cc:33:21: note: in expansion of macro '_print'
   33 |                     _print('+');
      |                     ^~~~~~
a.cc:5:24: error: 'cout' is not a member of 'std'
    5 | #define _print(n) std::cout << n
      |                        ^~~~
a.cc:35:21: note: in expansion of macro '_print'
   35 |                     _print('-');
      |                     ^~~~~~
a.cc:5:24: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #define _print(n) std::cout << n
      |                        ^~~~
a.cc:35:21: note: in expansion of macro '_print'
   35 |                     _print('-');
      |                     ^~~~~~
a.cc:5:24: error: 'cout' is not a member of 'std'
    5 | #define _print(n) std::cout << n
      |                        ^~~~
a.cc:37:17: note: in expansion of macro '_print'
   37 |                 _print(a[i]);
      |                 ^~~~~~
a.cc:5:24: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #define _print(n) std::cout << n
      |                        ^~~~
a.cc:37:17: note: in expansion of macro '_print'
   37 |                 _print(a[i]);
      |                 ^~~~~~
a.cc:4:23: error: 'cout' is not a member of 'std'
    4 | #define print(n) std::cout << n << std::endl
      |                       ^~~~
a.cc:39:13: note: in expansion of macro 'print'
   39 |             print("=7");
      |             ^~~~~
a.cc:4:23: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #define print(n) std::cout << n << std::endl
      |                       ^~~~
a.cc:39:13: note: in expansion of macro 'print'
   39 |             print("=7");
      |             ^~~~~
a.cc:4:41: error: 'endl' is not a member of 'std'
    4 | #define print(n) std::cout << n << std::endl
      |                                         ^~~~
a.cc:39:13: note: in expansion of macro 'print'
   39 |             print("=7");
      |             ^~~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | include <bits/stdc++.h>