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(){
    string s; cin >> s;
    int a, b, c, d;
    a = s[0] - '0';
    b = s[1] - '0';
    c = s[2] - '0';
    d = s[3] - '0';
    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:17:64: warning: multi-character character constant [-Wmultichar]
   17 |     if(a+b+c+d == 7) cout << a + '+' + b + '+' + c + '+' + d + '=7';
      |                                                                ^~~~
a.cc:18:64: warning: multi-character character constant [-Wmultichar]
   18 |     if(a+b+c-d == 7) cout << a + '+' + b + '+' + c + '-' + d + '=7';
      |                                                                ^~~~
a.cc: In function 'int main()':
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*
a.cc:20:42: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   20 |     if(a-b+c+d == 7) cout << a + "-" + b + "+" + c + "+" + d + "=7";
      |                              ~~~~~~~~~~~ ^ ~~~
      |                                      |     |
      |                                      |     const char [2]
      |                                      const char*
a.cc:21:42: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   21 |     if(a+b-c-d == 7) cout << a + "+" + b + "-" + c + "-" + d + "=7";
      |                              ~~~~~~~~~~~ ^ ~~~
      |                                      |     |
      |                                      |     const char [2]
      |                                      const char*
a.cc:22:42: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   22 |     if(a-b+c-d == 7) cout << a + "-" + b + "+" + c + "-" + d + "=7";
      |                              ~~~~~~~~~~~ ^ ~~~
      |                                      |     |
      |                                      |     const char [2]
      |                                      const char*
a.cc:23:42: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   23 |     if(a-b-c+d == 7) cout << a + "-" + b + "-" + c + "+" + d + "=7";
      |                              ~~~~~~~~~~~ ^ ~~~
      |                                      |     |
      |                                      |     const char [2]
      |                                      const char*
a.cc:24:42: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   24 |     if(a-b-c-d == 7) cout << a + "-" + b + "-" + c + "-" + d + "=7";
      |                              ~~~~~~~~~~~ ^ ~~~
      |                                      |     |
      |                                      |     const char [2]
      |                                      const char*