Language: C++

# include <bits/stdc++.h>
char s [5];
int main ()
{
scanf ("% s " ,& s );
int a = s [0] - ’0 ’ , b = s [1] - ’0 ’ , c = s [2] - ’0 ’ , d = s [3] - ’0 ’;
if (a -b -c - d ==7) printf ("% d -% d -% d -% d =7\ n " ,a ,b ,c , d );
else if (a -b - c + d ==7) printf ("% d -% d -% d +% d =7\ n " ,a ,b ,c , d );
else if (a - b +c - d ==7) printf ("% d -% d +% d -% d =7\ n " ,a ,b ,c , d );
else if (a - b + c + d ==7) printf ("% d -% d +% d +% d =7\ n " ,a ,b ,c , d );
else if ( a +b -c - d ==7) printf ("% d +% d -% d -% d =7\ n " ,a ,b ,c , d );
else if ( a +b - c + d ==7) printf ("% d +% d -% d +% d =7\ n " ,a ,b ,c , d );
else if ( a + b +c - d ==7) printf ("% d +% d +% d -% d =7\ n " ,a ,b ,c , d );
else if ( a + b + c + d ==7) printf ("% d +% d +% d +% d =7\ n " ,a ,b ,c , d );
}

Compiler output:
a.cc:6:17: error: extended character ’ is not valid in an identifier
    6 | int a = s [0] - ’0 ’ , b = s [1] - ’0 ’ , c = s [2] - ’0 ’ , d = s [3] - ’0 ’;
      |                 ^
a.cc:6:20: error: extended character ’ is not valid in an identifier
    6 | int a = s [0] - ’0 ’ , b = s [1] - ’0 ’ , c = s [2] - ’0 ’ , d = s [3] - ’0 ’;
      |                    ^
a.cc:6:36: error: extended character ’ is not valid in an identifier
    6 | int a = s [0] - ’0 ’ , b = s [1] - ’0 ’ , c = s [2] - ’0 ’ , d = s [3] - ’0 ’;
      |                                    ^
a.cc:6:39: error: extended character ’ is not valid in an identifier
    6 | int a = s [0] - ’0 ’ , b = s [1] - ’0 ’ , c = s [2] - ’0 ’ , d = s [3] - ’0 ’;
      |                                       ^
a.cc:6:55: error: extended character ’ is not valid in an identifier
    6 | int a = s [0] - ’0 ’ , b = s [1] - ’0 ’ , c = s [2] - ’0 ’ , d = s [3] - ’0 ’;
      |                                                       ^
a.cc:6:58: error: extended character ’ is not valid in an identifier
    6 | int a = s [0] - ’0 ’ , b = s [1] - ’0 ’ , c = s [2] - ’0 ’ , d = s [3] - ’0 ’;
      |                                                          ^
a.cc:6:74: error: extended character ’ is not valid in an identifier
    6 | int a = s [0] - ’0 ’ , b = s [1] - ’0 ’ , c = s [2] - ’0 ’ , d = s [3] - ’0 ’;
      |                                                                          ^
a.cc:6:77: error: extended character ’ is not valid in an identifier
    6 | int a = s [0] - ’0 ’ , b = s [1] - ’0 ’ , c = s [2] - ’0 ’ , d = s [3] - ’0 ’;
      |                                                                             ^
a.cc: In function 'int main()':
a.cc:6:17: error: '\U000020190' was not declared in this scope
    6 | int a = s [0] - ’0 ’ , b = s [1] - ’0 ’ , c = s [2] - ’0 ’ , d = s [3] - ’0 ’;
      |                 ^~
a.cc:7:8: error: 'b' was not declared in this scope
    7 | if (a -b -c - d ==7) printf ("% d -% d -% d -% d =7\ n " ,a ,b ,c , d );
      |        ^
a.cc:7:11: error: 'c' was not declared in this scope
    7 | if (a -b -c - d ==7) printf ("% d -% d -% d -% d =7\ n " ,a ,b ,c , d );
      |           ^
a.cc:7:15: error: 'd' was not declared in this scope
    7 | if (a -b -c - d ==7) printf ("% d -% d -% d -% d =7\ n " ,a ,b ,c , d );
      |               ^
a.cc:7:30: warning: unknown escape sequence: '\040'
    7 | if (a -b -c - d ==7) printf ("% d -% d -% d -% d =7\ n " ,a ,b ,c , d );
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:8:36: warning: unknown escape sequence: '\040'
    8 | else if (a -b - c + d ==7) printf ("% d -% d -% d +% d =7\ n " ,a ,b ,c , d );
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:9:36: warning: unknown escape sequence: '\040'
    9 | else if (a - b +c - d ==7) printf ("% d -% d +% d -% d =7\ n " ,a ,b ,c , d );
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:10:37: warning: unknown escape sequence: '\040'
   10 | else if (a - b + c + d ==7) printf ("% d -% d +% d +% d =7\ n " ,a ,b ,c , d );
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:11:36: warning: unknown escape sequence: '\040'
   11 | else if ( a +b -c - d ==7) printf ("% d +% d -% d -% d =7\ n " ,a ,b ,c , d );
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:12:37: warning: unknown escape sequence: '\040'
   12 | else if ( a +b - c + d ==7) printf ("% d +% d -% d +% d =7\ n " ,a ,b ,c , d );
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:13:37: warning: unknown escape sequence: '\040'
   13 | else if ( a + b +c - d ==7) printf ("% d +% d +% d -% d =7\ n " ,a ,b ,c , d );
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:14:38: warning: unknown escape sequence: '\040'
   14 | else if ( a + b + c + d ==7) printf ("% d +% d +% d +% d =7\ n " ,a ,b ,c , d );
      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~