Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define MM 1000000000;
#define mod MM + 7;
#define INF (ll)1e18
#define pi acos(-1.0)
#define MAX 100005
#define NIL -1
int main(){
    int a, b, c, d; cin >> a >> b >> c >> d;
    if(a+b+c+d == 7) cout << a + "+" + b + "+" + c + "+" + d + "=7";
    if(a+b+c-d == 7) cout << a + "+" + b + "+" + c + "-" + d + "=7";
    if(a+b-c+d == 7) cout << a + "+" + b + "-" + c + "+" + d + "=7";
    if(a-b+c+d == 7) cout << a + "-" + b + "+" + c + "+" + d + "=7";
    if(a+b-c-d == 7) cout << a + "+" + b + "-" + c + "-" + d + "=7";
    if(a-b+c-d == 7) cout << a + "-" + b + "+" + c + "-" + d + "=7";
    if(a-b-c+d == 7) cout << a + "-" + b + "-" + c + "+" + d + "=7";
    if(a-b-c-d == 7) cout << a + "-" + b + "-" + c + "-" + d + "=7";
    cout << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:42: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   12 |     if(a+b+c+d == 7) cout << a + "+" + b + "+" + c + "+" + d + "=7";
      |                              ~~~~~~~~~~~ ^ ~~~
      |                                      |     |
      |                                      |     const char [2]
      |                                      const char*
a.cc:13:42: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   13 |     if(a+b+c-d == 7) cout << a + "+" + b + "+" + c + "-" + d + "=7";
      |                              ~~~~~~~~~~~ ^ ~~~
      |                                      |     |
      |                                      |     const char [2]
      |                                      const char*
a.cc:14:42: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   14 |     if(a+b-c+d == 7) cout << a + "+" + b + "-" + c + "+" + d + "=7";
      |                              ~~~~~~~~~~~ ^ ~~~
      |                                      |     |
      |                                      |     const char [2]
      |                                      const char*
a.cc:15:42: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   15 |     if(a-b+c+d == 7) cout << a + "-" + b + "+" + c + "+" + d + "=7";
      |                              ~~~~~~~~~~~ ^ ~~~
      |                                      |     |
      |                                      |     const char [2]
      |                                      const char*
a.cc:16:42: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   16 |     if(a+b-c-d == 7) cout << a + "+" + b + "-" + c + "-" + d + "=7";
      |                              ~~~~~~~~~~~ ^ ~~~
      |                                      |     |
      |                                      |     const char [2]
      |                                      const char*
a.cc:17:42: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   17 |     if(a-b+c-d == 7) cout << a + "-" + b + "+" + c + "-" + d + "=7";
      |                              ~~~~~~~~~~~ ^ ~~~
      |                                      |     |
      |                                      |     const char [2]
      |                                      const char*
a.cc:18:42: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   18 |     if(a-b-c+d == 7) cout << a + "-" + b + "-" + c + "+" + d + "=7";
      |                              ~~~~~~~~~~~ ^ ~~~
      |                                      |     |
      |                                      |     const char [2]
      |                                      const char*
a.cc:19:42: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   19 |     if(a-b-c-d == 7) cout << a + "-" + b + "-" + c + "-" + d + "=7";
      |                              ~~~~~~~~~~~ ^ ~~~
      |                                      |     |
      |                                      |     const char [2]
      |                                      const char*