Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii  = pair<int,int>;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define MOD 1000000007
#define EPS 10e-8
int gcd(int a,int b){return b?gcd(b,a%b):a;}    //最大公約数
int lcm(int a, int b) {return a * b / gcd(a, b);}   //最小公倍数

int main() {
    int a, b, c, d;
    if(a+b+c+d==7){
        cout << a + "+" + b + "+" c + "+" + d + "=7" << endl;
    }
    else if(a+b+c-d==7){
        cout << a + "+" + b + "+" c + "-" + d + "=7" << endl;
    }
    else if(a+b-c+d==7){
        cout << a + "+" + b + "-" c + "+" + d + "=7" << endl;
    }
    else if(a+b-c-d==7){
        cout << a + "+" + b + "-" c + "-" + d + "=7" << endl;
    }
    else if(a-b+c+d==7){
        cout << a + "-" + b + "+" c + "+" + d + "=7" << endl;
    }
    else if(a-b+c-d==7){
        cout << a + "-" + b + "+" c + "-" + d + "=7" << endl;
    }
    else if(a-b-c+d==7){
        cout << a + "-" + b + "-" c + "+" + d + "=7" << endl;
    }
    else if(a-b-c-d==7){
        cout << a + "-" + b + "-" c + "-" + d + "=7" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:29: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   15 |         cout << a + "+" + b + "+" c + "+" + d + "=7" << endl;
      |                 ~~~~~~~~~~~ ^ ~~~
      |                         |     |
      |                         |     const char [2]
      |                         const char*
a.cc:18:29: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   18 |         cout << a + "+" + b + "+" c + "-" + d + "=7" << endl;
      |                 ~~~~~~~~~~~ ^ ~~~
      |                         |     |
      |                         |     const char [2]
      |                         const char*
a.cc:21:29: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   21 |         cout << a + "+" + b + "-" c + "+" + d + "=7" << endl;
      |                 ~~~~~~~~~~~ ^ ~~~
      |                         |     |
      |                         |     const char [2]
      |                         const char*
a.cc:24:29: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   24 |         cout << a + "+" + b + "-" c + "-" + d + "=7" << endl;
      |                 ~~~~~~~~~~~ ^ ~~~
      |                         |     |
      |                         |     const char [2]
      |                         const char*
a.cc:27:29: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   27 |         cout << a + "-" + b + "+" c + "+" + d + "=7" << endl;
      |                 ~~~~~~~~~~~ ^ ~~~
      |                         |     |
      |                         |     const char [2]
      |                         const char*
a.cc:30:29: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   30 |         cout << a + "-" + b + "+" c + "-" + d + "=7" << endl;
      |                 ~~~~~~~~~~~ ^ ~~~
      |                         |     |
      |                         |     const char [2]
      |                         const char*
a.cc:33:29: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   33 |         cout << a + "-" + b + "-" c + "+" + d + "=7" << endl;
      |                 ~~~~~~~~~~~ ^ ~~~
      |                         |     |
      |                         |     const char [2]
      |                         const char*
a.cc:36:29: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   36 |         cout << a + "-" + b + "-" c + "-" + d + "=7" << endl;
      |                 ~~~~~~~~~~~ ^ ~~~
      |                         |     |
      |                         |     const char [2]
      |                         const char*