Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
    string S;
    cin >> S;
    int a = s.at(0) - '0', b = s.at(1) - '0', c = s.at(2) -'0', d = s.at(3) - '0';
    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;
    return 0;
}


Compiler output:
a.cc:8:73: warning: multi-character character constant [-Wmultichar]
    8 |     if (a-b-c-d  == 7) cout << a << '-' << b << '-' << c << '-' << d << '=7' << endl;
      |                                                                         ^~~~
a.cc:9:78: warning: multi-character character constant [-Wmultichar]
    9 |     else if (a-b-c+d  == 7) cout << a << '-' << b << '-' << c << '+' << d << '=7' << endl;
      |                                                                              ^~~~
a.cc:10:78: warning: multi-character character constant [-Wmultichar]
   10 |     else if (a-b+c-d  == 7) cout << a << '-' << b << '+' << c << '-' << d << '=7' << endl;
      |                                                                              ^~~~
a.cc:11:78: warning: multi-character character constant [-Wmultichar]
   11 |     else if (a-b+c+d  == 7) cout << a << '-' << b << '+' << c << '+' << d << '=7' << endl;
      |                                                                              ^~~~
a.cc:12:78: warning: multi-character character constant [-Wmultichar]
   12 |     else if (a+b-c-d  == 7) cout << a << '+' << b << '-' << c << '-' << d << '=7' << endl;
      |                                                                              ^~~~
a.cc:13:78: warning: multi-character character constant [-Wmultichar]
   13 |     else if (a+b-c+d  == 7) cout << a << '+' << b << '-' << c << '+' << d << '=7' << endl;
      |                                                                              ^~~~
a.cc:14:78: warning: multi-character character constant [-Wmultichar]
   14 |     else if (a+b+c-d  == 7) cout << a << '+' << b << '+' << c << '-' << d << '=7' << endl;
      |                                                                              ^~~~
a.cc:15:78: warning: multi-character character constant [-Wmultichar]
   15 |     else if (a+b+c+d  == 7) cout << a << '+' << b << '+' << c << '+' << d << '=7' << endl;
      |                                                                              ^~~~
a.cc: In function 'int main()':
a.cc:7:13: error: 's' was not declared in this scope
    7 |     int a = s.at(0) - '0', b = s.at(1) - '0', c = s.at(2) -'0', d = s.at(3) - '0';
      |             ^
a.cc:8:11: error: 'b' was not declared in this scope
    8 |     if (a-b-c-d  == 7) cout << a << '-' << b << '-' << c << '-' << d << '=7' << endl;
      |           ^
a.cc:8:13: error: 'c' was not declared in this scope
    8 |     if (a-b-c-d  == 7) cout << a << '-' << b << '-' << c << '-' << d << '=7' << endl;
      |             ^
a.cc:8:15: error: 'd' was not declared in this scope
    8 |     if (a-b-c-d  == 7) cout << a << '-' << b << '-' << c << '-' << d << '=7' << endl;
      |               ^