Language: C++

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

int main() {
    char ch, b[4];
    int a[4], s1= 0,s2 = 0, i, j, k, m;
    for (i, 0, 3) {
        cin >> ch;
        a[i] = ch - '0';
        s1 += a[i];
    }
    if (s1 == 7) {
        cout << a[0];
        for(i, 1, 3){
            cout << '+' << a[i];
        }
        cout << "=7" << endl;
    }
    else {
		s2 = a[0];
        for(i, 1, 3){
            s2 -= a[i];
        }
        if (s2 == 7) {
            cout << a[0];
            for(i, 1, 3){
               cout << '-' << a[i];
            }
          cout << "=7" << endl;
        }
		else {
			for (k, 0, 1) {
				for (i, 1, 3) {
					for (j, 1, 3) {
						if (j == i) k == 0 ? b[j] = '+' : b[j] = '-';
						else k == 0 ? b[j] = '-' : b[j] = '+';
					}
					m = k == 0 ? s2 + 2 * a[i]: s1 - 2 * a[i];
					if (m == 7) { 
					    cout << a[0];
                        for(i, 1, 3){
                           cout << b[i] << a[i];
                        }
                        cout << "=7" << endl;
                        exit(0); 
					}
				}
			}
		}   
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: expected ';' before ')' token
    7 |     for (i, 0, 3) {
      |                 ^
      |                 ;
a.cc:12:5: error: expected primary-expression before 'if'
   12 |     if (s1 == 7) {
      |     ^~
a.cc:11:6: error: expected ';' before 'if'
   11 |     }
      |      ^
      |      ;
   12 |     if (s1 == 7) {
      |     ~~
a.cc:12:5: error: expected primary-expression before 'if'
   12 |     if (s1 == 7) {
      |     ^~
a.cc:11:6: error: expected ')' before 'if'
   11 |     }
      |      ^
      |      )
   12 |     if (s1 == 7) {
      |     ~~
a.cc:7:9: note: to match this '('
    7 |     for (i, 0, 3) {
      |         ^
a.cc:14:20: error: expected ';' before ')' token
   14 |         for(i, 1, 3){
      |                    ^
      |                    ;
a.cc:18:5: error: expected primary-expression before '}' token
   18 |     }
      |     ^
a.cc:17:30: error: expected ')' before '}' token
   17 |         cout << "=7" << endl;
      |                              ^
      |                              )
   18 |     }
      |     ~                         
a.cc:14:12: note: to match this '('
   14 |         for(i, 1, 3){
      |            ^
a.cc:18:5: error: expected primary-expression before '}' token
   18 |     }
      |     ^
a.cc:21:20: error: expected ';' before ')' token
   21 |         for(i, 1, 3){
      |                    ^
      |                    ;
a.cc:24:9: error: expected primary-expression before 'if'
   24 |         if (s2 == 7) {
      |         ^~
a.cc:23:10: error: expected ';' before 'if'
   23 |         }
      |          ^
      |          ;
   24 |         if (s2 == 7) {
      |         ~~
a.cc:24:9: error: expected primary-expression before 'if'
   24 |         if (s2 == 7) {
      |         ^~
a.cc:23:10: error: expected ')' before 'if'
   23 |         }
      |          ^
      |          )
   24 |         if (s2 == 7) {
      |         ~~
a.cc:21:12: note: to match this '('
   21 |         for(i, 1, 3){
      |            ^
a.cc:26:24: error: expected ';' before ')' token
   26 |             for(i, 1, 3){
      |                        ^
      |                        ;
a.cc:30:9: error: expected primary-expression before '}' token
   30 |         }
      |         ^
a.cc:29:32: error: expected ')' before '}' token
   29 |           cout << "=7" << endl;
      |                                ^
      |                                )
   30 |         }
      |         ~                       
a.cc:26:16: note: to match this '('
   26 |             for(i, 1, 3){
      |                ^
a.cc:30:9: error: expected primary-expression before '}' token
   30 |         }
      |         ^
a.cc:32:37: error: expected ';' before ')' token
   32 |                         for (k, 0, 1) {
      |                                     ^
      |                                     ;
a.cc:49:17: error: expected primary-expression before '}' token
   49 |                 }
      |                 ^
a.cc:48:26: error: expected ';' before '}' token
   48 |                         }
      |                          ^
      |                          ;
   49 |                 }
      |                 ~         
a.cc:49:17: error: expected primary-expression before '}' token
   49 |                 }
      |                 ^
a.cc:48:26: error: expected ')' before '}' token
   48 |                         }
      |                          ^
      |                          )
   49 |                 }
      |                 ~         
a.cc:32:29: note: to match this '('
   32 |                         for (k, 0, 1) {
      |                             ^
a.cc:49:17: error: expected primary-expression before '}' token
   49 |                 }
      |                 ^