criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<cstdio>
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:24: 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:24: error: extended character ’ is not valid in an identifier
a.cc:6:40: 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:40: error: extended character ’ is not valid in an identifier
a.cc:6:57: 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:57: error: extended character ’ is not valid in an identifier
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:74: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:6:24: error: '\U000020190\U00002019' 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:16: 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:19: 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:23: 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 );
      |                       ^
Language: C++

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

int calc(int a, int b, int  flag){
    if(flag ==0) return a + b;
    else return a - b;
}


int main(){
    string n;
    cin >> n;

    int a,b,c,d;
    a = n[0] - '0';
    b = n[1] - '0';
    c = n[2] - '0';
    d = n[3] - '0';

    string op = "+-";
    for(int op1=0; op1<2; op1++){
        for(int op2=0; op2<2; op2++){
            for(int op3=0; op3<2; op3++){
                
                int sum = calc(a, b, op1);
                sum = calc(sum, c, op2);
                sum = calc(sum, d, op3);
                
                if(sum == 7){
                    cout << a << op[op1] << b << op[op2] << c << op[op3] << d << "=7";
                    return;
                }
            }   
        }   
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:21: error: return-statement with no value, in function returning 'int' [-fpermissive]
   31 |                     return;
      |                     ^~~~~~
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);


int g[15][15];
const int INF = 1001001001;
const int di[] = { -1,0,1,0 };
const int dj[] = { 0,-1,0,1 };

//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

//素因数分解
vector<pair<ll, int>>factorize(ll n) {
	vector<pair<ll, int>>res;
	for (ll i = 2;i * i <= n;++i) {
		if (n % i)continue;
		res.emplace_back(i, 0);
		while (n % i == 0) {
			n /= i;
			res.back().second++;
		}
	}
	if (n != 1)res.emplace_back(n, 1);
	return res;
}

int main() {
	string s;
	cin >> 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);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:40: error: unable to find character literal operator 'operator""c' with 'char' argument
   40 |         int a = s[0] - '0', b = s[1] - '0'c = s[2] - '0', d = s[3] - '0';
      |                                        ^~~~
a.cc:41:21: error: 'c' was not declared in this scope
   41 |         if (a + b + c + d == 7)printf("%d+%d+%d+%d=7\n", a, b, c, d);
      |                     ^
a.cc:41:25: error: 'd' was not declared in this scope
   41 |         if (a + b + c + d == 7)printf("%d+%d+%d+%d=7\n", a, b, c, d);
      |                         ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);


int g[15][15];
const int INF = 1001001001;
const int di[] = { -1,0,1,0 };
const int dj[] = { 0,-1,0,1 };

//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

//素因数分解
vector<pair<ll, int>>factorize(ll n) {
	vector<pair<ll, int>>res;
	for (ll i = 2;i * i <= n;++i) {
		if (n % i)continue;
		res.emplace_back(i, 0);
		while (n % i == 0) {
			n /= i;
			res.back().second++;
		}
	}
	if (n != 1)res.emplace_back(n, 1);
	return res;
}

int main() {
	char s;
	cin >> 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);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:18: error: invalid types 'char[int]' for array subscript
   40 |         int a = s[0] + '0', b = s[1] + '0',c = s[2] + '0', d = s[3] + '0';
      |                  ^
a.cc:41:17: error: 'b' was not declared in this scope
   41 |         if (a + b + c + d == 7)printf("%d+%d+%d+%d=7\n", a, b, c, d);
      |                 ^
a.cc:41:21: error: 'c' was not declared in this scope
   41 |         if (a + b + c + d == 7)printf("%d+%d+%d+%d=7\n", a, b, c, d);
      |                     ^
a.cc:41:25: error: 'd' was not declared in this scope
   41 |         if (a + b + c + d == 7)printf("%d+%d+%d+%d=7\n", a, b, c, d);
      |                         ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);


int g[15][15];
const int INF = 1001001001;
const int di[] = { -1,0,1,0 };
const int dj[] = { 0,-1,0,1 };

//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

//素因数分解
vector<pair<ll, int>>factorize(ll n) {
	vector<pair<ll, int>>res;
	for (ll i = 2;i * i <= n;++i) {
		if (n % i)continue;
		res.emplace_back(i, 0);
		while (n % i == 0) {
			n /= i;
			res.back().second++;
		}
	}
	if (n != 1)res.emplace_back(n, 1);
	return res;
}

int main() {
	string s;
	cin >> 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);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:40: error: unable to find character literal operator 'operator""c' with 'char' argument
   40 |         int a = s[0] + '0', b = s[1] + '0'c = s[2] + '0', d = s[3] + '0';
      |                                        ^~~~
a.cc:41:21: error: 'c' was not declared in this scope
   41 |         if (a + b + c + d == 7)printf("%d+%d+%d+%d=7\n", a, b, c, d);
      |                     ^
a.cc:41:25: error: 'd' was not declared in this scope
   41 |         if (a + b + c + d == 7)printf("%d+%d+%d+%d=7\n", a, b, c, d);
      |                         ^
Language: C++

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

int main() {
  int a,b,c,d;
  char x,y,z:
  cin >> a>>b>>c>>d;
  if(a+b+c+d==7){
    x='+';
    y='+';
    z='+';
  }
  if(a+b+c-d==7){
    x='+';
    y='+';
    z='-';
  }
  if(a+b-c+d==7){
    x='+';
    y='-';
    z='+';
  }
  if(a-b+c+d==7){
    x='-';
    y='+';
    z='+';
  }
  if(a+b-c-d==7){
    x='+';
    y='-';
    z='-';
  }
  if(a-b-c+d==7){
    x='-';
    y='-';
    z='+';
  }
  if(a-b+c-d==7){
    x='-';
    y='+';
    z='-';
  }
  if(a-b-c-d==7){
    x='-';
    y='-';
    z='-';
  }
  cout <<a<<x<<b<<y<<c<<z<<d<<"=7"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: found ':' in nested-name-specifier, expected '::'
    6 |   char x,y,z:
      |             ^
      |             ::
a.cc:6:12: error: 'z' has not been declared
    6 |   char x,y,z:
      |            ^
a.cc:7:7: error: qualified-id in declaration before '>>' token
    7 |   cin >> a>>b>>c>>d;
      |       ^~
a.cc:11:5: error: 'z' was not declared in this scope
   11 |     z='+';
      |     ^
a.cc:16:5: error: 'z' was not declared in this scope
   16 |     z='-';
      |     ^
a.cc:21:5: error: 'z' was not declared in this scope
   21 |     z='+';
      |     ^
a.cc:26:5: error: 'z' was not declared in this scope
   26 |     z='+';
      |     ^
a.cc:31:5: error: 'z' was not declared in this scope
   31 |     z='-';
      |     ^
a.cc:36:5: error: 'z' was not declared in this scope
   36 |     z='+';
      |     ^
a.cc:41:5: error: 'z' was not declared in this scope
   41 |     z='-';
      |     ^
a.cc:46:5: error: 'z' was not declared in this scope
   46 |     z='-';
      |     ^
a.cc:48:25: error: 'z' was not declared in this scope
   48 |   cout <<a<<x<<b<<y<<c<<z<<d<<"=7"<<endl;
      |                         ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

bool rec(int i, int result, vector<int> &nums, vector<char> &ops) {
    if (i == 0) {
        result = result - nums[i];
        if (result == 0) {
            return true;
        }
        return false;
    }

    if (rec(i-1, result + nums[i], nums, ops)) {
        ops.push_back('-');
        return true;
    }
    if (rec(i-1, result - nums[i], nums, ops)) {
        ops.push_back('+');
        return true;
    }

    return false;
}

int main() {
    cin.tie(0);
   	ios::sync_with_stdio(false);
    string line;
    cin >> line;

    vector<int> nums;
    for (auto i: line) {
        nums.push_back(i - '0');
    }

    vector<char> ops;

    rec(3, 7, nums, ops);

    string result = "";

    result += line[0];

    for (int i=1; i<4;i++) {
        result += ops[i-1];
        result += line[i];
    }

    result += '=7'

    cout << result << endl;
}


Compiler output:
a.cc:51:15: warning: multi-character character constant [-Wmultichar]
   51 |     result += '=7'
      |               ^~~~
a.cc: In function 'int main()':
a.cc:51:15: warning: overflow in conversion from 'int' to 'char' changes value from '15671' to '55' [-Woverflow]
a.cc:51:19: error: expected ';' before 'cout'
   51 |     result += '=7'
      |                   ^
      |                   ;
   52 | 
   53 |     cout << result << endl;
      |     ~~~~
Language: C++

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

int main(){
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  
  if(a + b + c + d = 7){
    printf("%d+%d+%d+%d=7/n",a,b,c,d);
    return 0;
  }
  
  if(a + b + c - d = 7){
    printf("%d+%d+%d-%d=7/n",a,b,c,d);
    return 0;
  }
  
  if(a + b - c + d = 7){
    printf("%d+%d-%d+%d=7/n",a,b,c,d);
    return 0;
  }
  
  if(a + b - c - d = 7){
    printf("%d+%d-%d-%d=7/n",a,b,c,d);
    return 0;
  }

  if(a - b + c + d = 7){
    printf("%d-%d+%d+%d=7/n",a,b,c,d);
    return 0;
  }
  
  if(a - b + c - d = 7){
    printf("%d-%d+%d-%d=7/n",a,b,c,d);
    return 0;
  }
  
  if(a - b - c + d = 7){
    printf("%d-%d-%d+%d=7/n",a,b,c,d);
    return 0;
  }
  
  if(a - b - c - d = 7){
    printf("%d-%d-%d-%d=7/n",a,b,c,d);
    return 0;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: lvalue required as left operand of assignment
    8 |   if(a + b + c + d = 7){
      |      ~~~~~~~~~~^~~
a.cc:13:16: error: lvalue required as left operand of assignment
   13 |   if(a + b + c - d = 7){
      |      ~~~~~~~~~~^~~
a.cc:18:16: error: lvalue required as left operand of assignment
   18 |   if(a + b - c + d = 7){
      |      ~~~~~~~~~~^~~
a.cc:23:16: error: lvalue required as left operand of assignment
   23 |   if(a + b - c - d = 7){
      |      ~~~~~~~~~~^~~
a.cc:28:16: error: lvalue required as left operand of assignment
   28 |   if(a - b + c + d = 7){
      |      ~~~~~~~~~~^~~
a.cc:33:16: error: lvalue required as left operand of assignment
   33 |   if(a - b + c - d = 7){
      |      ~~~~~~~~~~^~~
a.cc:38:16: error: lvalue required as left operand of assignment
   38 |   if(a - b - c + d = 7){
      |      ~~~~~~~~~~^~~
a.cc:43:16: error: lvalue required as left operand of assignment
   43 |   if(a - b - c - d = 7){
      |      ~~~~~~~~~~^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
	char a1,b1,c1,d1;
	int ans,a,b,c,d;
	cin>>a1>>b1>>c1>>d1;
	a=a1-'0';
	b=b1-'0';
	c=c1-'0';
	d=d1-'0';
	for(char i="+"; i<="-"; i++)
		for(char j="+"; j<="-"; j++)
			for(char k="+"; k<="-"; k++) {
				ans=a;
				if(i=='+')ans+=b;
				else if(i=='-')ans-=b;
				if(j=='+')ans+=c;
				else if(j=='-')ans-=c;
				if(k=='+')ans+=d;
				else if(k=='-')ans-=d;
				if(ans==7) {
					cout<<a<<i<<b<<j<<c<<k<<d<<"="<<ans<<endl;
					return 0;
				}
			}


}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   11 |         for(char i="+"; i<="-"; i++)
      |                    ^~~
      |                    |
      |                    const char*
a.cc:11:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         for(char i="+"; i<="-"; i++)
      |                         ~^~~~~
a.cc:12:28: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   12 |                 for(char j="+"; j<="-"; j++)
      |                            ^~~
      |                            |
      |                            const char*
a.cc:12:34: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |                 for(char j="+"; j<="-"; j++)
      |                                 ~^~~~~
a.cc:13:36: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   13 |                         for(char k="+"; k<="-"; k++) {
      |                                    ^~~
      |                                    |
      |                                    const char*
a.cc:13:42: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |                         for(char k="+"; k<="-"; k++) {
      |                                         ~^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (in i = 0; i < (in)(n); i++)
const double PI=3.14159265358979323846;
const int64_t waru = 1000000007;
const in INF=1<<30;
#define vec2(a,y,x) vector<vector<int>> a(y,vector<int>(x))
#define vec1(a,n) vector<in> a(n);rep(i,n)cin>>a[i]

int main(){
  int x;cin>>x;
  int d=x%10;x/=10;
  int c=x%10;x/=10;
  int b=x%10;x/=10;
  int a=x;
  int aa,bb,cc,dd;
  char cb,cc,cd;
  
for (int tmp = 0; tmp < (1 << 3); tmp++) {
  bitset<3> s(tmp);
  if(s.test(0)) {bb =(-1)*b;cb='-';} else{ bb=b;cb='+';}
  if(s.test(1)) {cc =(-1)*c;cc='-';} else{ cc=c;cc='+';}
  if(s.test(2)) {dd =(-1)*d;cd='-';} else{ dd=d;cd='+';}
  if(a+bb+cc+dd==7){
     cout<<a<<cb<<b<<cc<<c<<cd<<d<<"=7";
    break;
  }
}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:11: error: conflicting declaration 'char cc'
   20 |   char cb,cc,cd;
      |           ^~
a.cc:19:13: note: previous declaration as 'int cc'
   19 |   int aa,bb,cc,dd;
      |             ^~
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  vll a(4)
  cin>>a[0]>>a[1]>>a[2]>>a[3];
  for(int bit=0;bit<(1<<3);bit++){
    ll k=a[0];
    vector<char> y(3);
    for(int i=0;i<3;i++){
      if((1<<i)&bit){
        k+=a[i+1];
        y[i]='+';
      }
      else{
        k-=a[i+1];
        y[i]='-';
      }
    }
    if(k==7){
      cout<<a[0]<<y[0]<<a[1]<<y[1]<<a[2]<<y[2]<<a[3]<<y[3]<<a[4]<<"="<<7;
      return 0;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:3: error: expected ',' or ';' before 'cin'
   38 |   cin>>a[0]>>a[1]>>a[2]>>a[3];
      |   ^~~
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  vll a(4)
  cin>>a[0]>>a[1]>>a[2]>>a[3];
  for(int bit=0;bit<(1<<3);bit++){
    ll k=a;
    vector<char> y(3);
    for(int i=0;i<3;i++){
      if((1<<i)&bit){
        k+=a[i+1];
        y[i]='+';
      }
      else{
        k-=a[i+1];
        y[i]='-';
      }
    }
    if(k==7){
      cout<<a[0]<<y[0]<<a[1]<<y[1]<<a[2]<<y[2]<<a[3]<<y[3]<<a[4]<<"="<<7;
      return 0;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:3: error: expected ',' or ';' before 'cin'
   38 |   cin>>a[0]>>a[1]>>a[2]>>a[3];
      |   ^~~
a.cc:40:10: error: cannot convert 'vll' {aka 'std::vector<long long int>'} to 'long long int' in initialization
   40 |     ll k=a;
      |          ^
      |          |
      |          vll {aka std::vector<long long int>}
Language: C++

#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
#include<utility>
#define REP(i, m, n) for(long long i = m; i < n; ++i)
#define CO(n) cout << n << endl
using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    string S;
    cin >> S;
    int A[4];
    REP(i,0,4){
        A[i] = (int)(S[i]-'0');
    }
    REP(i,0,4) cout << A[i] << endl;
    int total = 0;
    REP(i,0,8){
        bitset<3> bs(2);
        string simb = bs.to_string();
        total = A[0];
        REP(j,1,4){
            if (simb[j-1]=='0') total += A[j];
            else total -= A[j];
        }
        //cout << total << endl;
        if (total == 7){
            string calc = "";
            REP(j,0,3){
                if (simb[j] == '0') calc += '+';
                else calc += '-';
            }
            cout << calc << endl; 
            string equation = "";
            REP(i,0,4){
                //CO(equation);
                equation = equation + S[i]+calc[i];
            }
            cout << equation + "=7" << endl;
            return 0;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'bitset' was not declared in this scope
   24 |         bitset<3> bs(2);
      |         ^~~~~~
a.cc:8:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
    7 | #include<utility>
  +++ |+#include <bitset>
    8 | #define REP(i, m, n) for(long long i = m; i < n; ++i)
a.cc:24:19: error: 'bs' was not declared in this scope; did you mean 'abs'?
   24 |         bitset<3> bs(2);
      |                   ^~
      |                   abs
Language: C++

#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
#include<utility>
#define REP(i, m, n) for(long long i = m; i < n; ++i)
#define CO(n) cout << n << endl
using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    string S;
    cin >> S;
    int A[4];
    REP(i,0,4){
        A[i] = (int)(S[i]-'0');
    }
    REP(i,0,4) cout << A[i] << endl;
    int total = 0;
    REP(i,0,8){
        string simb = bitset<3>(i).to_string();
        total = A[0];
        //cout << simb << endl;
        //cout << total << endl;
        REP(j,1,4){
            if (simb[j-1]=='0') total += A[j];
            else total -= A[j];
        }
        //cout << total << endl;
        if (total == 7){
            string calc = "";
            REP(j,0,3){
                if (simb[j] == '0') calc += '+';
                else calc += '-';
            }
            cout << calc << endl; 
            string equation = "";
            REP(i,0,4){
                //CO(equation);
                equation = equation + S[i]+calc[i];
            }
            cout << equation + "=7" << endl;
            return 0;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:23: error: 'bitset' was not declared in this scope
   24 |         string simb = bitset<3>(i).to_string();
      |                       ^~~~~~
a.cc:8:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
    7 | #include<utility>
  +++ |+#include <bitset>
    8 | #define REP(i, m, n) for(long long i = m; i < n; ++i)
a.cc:24:36: error: request for member 'to_string' in 'i', which is of non-class type 'long long int'
   24 |         string simb = bitset<3>(i).to_string();
      |                                    ^~~~~~~~~
Language: C++

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

int main() {
  string s;
  cin >> s;
  int a,b,c,d;
  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) cout << a << "-" << b << "+" << c << "+" << d << "=7" << endl;
  else if (a+b-c+d) cout << a << "+" << b << "-" << c << "+" << d << "=7" << endl;
  else if (a-b-c+d) cout << a << "-" << b << "-" << c << "+" << d << "=7" << endl;
  else if (a+b+c-d) cout << a << "+" << b << "+" << c << "-" << d << "=7" << endl;
  else if (a-b+c-d) cout << a << "-" << b << "+" << c << "-" << d << "=7" << endl;
  else if (a+b-c-d) cout << a << "+" << b << "-" << c << "-" << d << "=7" << endl;
  else if (a-b-c-d) cout << a << "-" << b << "-" << c << "-" << d << "=7" << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: lvalue required as left operand of assignment
   12 |   if (a+b+c+d=7) cout << a << "+" << b << "+" << c << "+" << d << "=7" << endl;
      |       ~~~~~^~
Language: C++

def saiki(i,x,op):
    if i == 4:
        if x == 7:
            return op+"=7"
        else:
            return ""

    opP = saiki(i+1,x+n[i],op+"+"+str(n[i]))
    if opP != "":
        return opP
    opM = saiki(i+1,x-n[i],op+"-"+str(n[i]))
    if opM != "":
        return opM
    return ""


n = [int(s) for s in list(input())]
print(saiki(1,n[0],str(n[0])))

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def saiki(i,x,op):
      | ^~~
Language: C++

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)

const int MOD = 1000000007;
const int INF_32 = 1LL << 30;
const int64_t INF_64 = 1LL << 60;

template <class T>
inline bool chmin(T& a, T b)
{
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T>
inline bool chmax(T& a, T b)
{
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

typedef long long ll;

#define MAX_N 10000

struct Edge {
    int to;
    int weight;
    Edge(int t, int w)
        : to(t)
        , weight(w)
    {
    }
};
using Graph = vector<vector<int>>;
using Graph_e = vector<vector<Edge>>;

int main()
{
    string s;
    cin >> s;

    const int size = 4;

    for (int temp = 0; temp < (1 << size - 1); temp++) {
        int sum = s[0] - '0';
        string ans;
        ans += s[0];

        for (int i = 0; i < size - 1; i++) {
            int t = s[i + 1] - '0';
            if (temp & (1 << i)) {
                sum += t;
                ans += '+';
                ans += s[i + 1];
            } else {
                sum -= t;
                ans += '-';
                ans += s[i + 1];
            }
        }
        ans += "=7";

        if (sum == 7) {
            cout << ans << endl;
            return;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:74:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
   74 |             return;
      |             ^~~~~~
Language: C++

#include <bits/stdc++.h>
#include <iostream>
using namespace std;
typedef long long ll;

int f(char s){
  int i;
  for(int j=0;j<=9;j++){
    if('j' = s){
      i=j;
      break;
    }
  }
  return i;
}
  
int main(){
  int s;
  cin >> s
  vector<int> a(4);
  for(int i=0;i<4;i++){
    a.at(i) = f(s.at(i));
  }
  cout << a.at(2) << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int f(char)':
a.cc:9:8: error: lvalue required as left operand of assignment
    9 |     if('j' = s){
      |        ^~~
a.cc: In function 'int main()':
a.cc:19:11: error: expected ';' before 'vector'
   19 |   cin >> s
      |           ^
      |           ;
   20 |   vector<int> a(4);
      |   ~~~~~~   
a.cc:22:5: error: 'a' was not declared in this scope
   22 |     a.at(i) = f(s.at(i));
      |     ^
a.cc:22:19: error: request for member 'at' in 's', which is of non-class type 'int'
   22 |     a.at(i) = f(s.at(i));
      |                   ^~
a.cc:24:11: error: 'a' was not declared in this scope
   24 |   cout << a.at(2) << endl;
      |           ^
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  int a;
  cin>>a;
  vector<int> s(3);
  ll c=0;
  s[0]=(a-(a/1000*1000))/100;
  s[1]=(a-(a/100*100))/10;
  s[2]=a%10;
  for(int bit=0;bit<(1<<3);bit++){
    ll cu=a/1000;
    vll d(0)
    for(int i=0;i<3;i++){
      if(bit&(1<<i)){
        cu+=s[i];
        d.pb(1);
      }
      else{
        cu-=s[i];
        d.pb(0);
      }
    }
    if(cu==7){
      cout<<a;
      if(d[0]==1) cout<<'+';
      else cout<<'-';
      cout<<s[0];
      if(d[1]==1) cout<<'+';
      else cout<<'-';
      cout<<s[1];
      if(d[2]==1) cout<<'+';
      else cout<<'-';
      cout<<s[2];
      break;
      cout<<'='<<7;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:5: error: expected ',' or ';' before 'for'
   47 |     for(int i=0;i<3;i++){
      |     ^~~
a.cc:47:17: error: 'i' was not declared in this scope
   47 |     for(int i=0;i<3;i++){
      |                 ^
Language: C++

#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
int main(){
  int a;
  cin>>a;
  vector<int> s(3);
  ll c=0;
  s[0]=(a-(a/1000*1000))/100;
  s[1]=(a-(a/100*100))/10;
  s[2]=a%10;
  for(int bit=0;bit<(1<<3);bit++){
    ll cu=a/1000;
    vll d(0)
    for(int i=0;i<3;i++){
      if(bit&(1<<i)){
        cu+=s[i];
        d.pb(1);
      }
      else{
        cu-=s[i];
        d.pb(0);
      }
    }
    if(cu==7){
      cout<<a;
      if(d[0]==1) cout<<'+';
      else cout<<'-';
      cout<<s[0];
      if(d[1]==1) cout<<'+';
      else cout<<'-';
      cout<<s[1];
      if(d[2]==1) cout<<'+';
      else cout<<'-';
      cout<<s[2];
      break;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:5: error: expected ',' or ';' before 'for'
   47 |     for(int i=0;i<3;i++){
      |     ^~~
a.cc:47:17: error: 'i' was not declared in this scope
   47 |     for(int i=0;i<3;i++){
      |                 ^
Language: C++

#if 0
int main()
{
    int x;
    cin >> x;
    vi a{(x / 1000) % 10, (x / 100) % 10, (x / 10) % 10, x % 10};

    string exp;
    function<bool (int, int)> backtrack = [&](int level, int acc) {
        if (level == 4) {
            if (acc == 7) {
                cout << exp << "=7" << endl;
                return true;
            } else {
                return false;
            }
        }
        exp += "+" + to_string(a[level]);
        if (backtrack(level + 1, acc + a[level])) return true;
        exp.erase(exp.size() - 2);
        exp += "-" + to_string(a[level]);
        if (backtrack(level + 1, acc - a[level])) return true;
        exp.erase(exp.size() - 2);
        return false;
    };
    exp = to_string(a[0]);
    backtrack(1, a[0]);
    return 0;
}
#endif



Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

# include < cstdio >
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:1:11: fatal error:  cstdio : No such file or directory
    1 | # include < cstdio >
      |           ^~~~~~~~~~
compilation terminated.
Language: C++

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

int main() {
  int N,A,B,C,D;
  cin>>N;
  A=N/1000;
  B=(N-A*1000)/100;
  N=N-A*1000-B*100;
  C=N/10;
  D=N-C*10;
  char op1,op2,op3;
  if(A+B+C+D=7){op1='+',op2='+',op3='+';}
  if(A+B+C-D=7){op1='+',op2='+',op3='-';}
  if(A+B-C+D=7){op1='+',op2='-',op3='+';}
  if(A+B-C-D=7){op1='+',op2='-',op3='-';}
  if(A-B+C+D=7){op1='-',op2='+',op3='+';}
  if(A-B+C-D=7){op1='-',op2='+',op3='-';}
  if(A-B-C+D=7){op1='-',op2='-',op3='+';}
  if(A-B-C-D=7){op1='-',op2='-',op3='-';}
  cout<<A<<op1<<B<<op2<<C<<op3<<D<<"=7"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: lvalue required as left operand of assignment
   13 |   if(A+B+C+D=7){op1='+',op2='+',op3='+';}
      |      ~~~~~^~
a.cc:14:11: error: lvalue required as left operand of assignment
   14 |   if(A+B+C-D=7){op1='+',op2='+',op3='-';}
      |      ~~~~~^~
a.cc:15:11: error: lvalue required as left operand of assignment
   15 |   if(A+B-C+D=7){op1='+',op2='-',op3='+';}
      |      ~~~~~^~
a.cc:16:11: error: lvalue required as left operand of assignment
   16 |   if(A+B-C-D=7){op1='+',op2='-',op3='-';}
      |      ~~~~~^~
a.cc:17:11: error: lvalue required as left operand of assignment
   17 |   if(A-B+C+D=7){op1='-',op2='+',op3='+';}
      |      ~~~~~^~
a.cc:18:11: error: lvalue required as left operand of assignment
   18 |   if(A-B+C-D=7){op1='-',op2='+',op3='-';}
      |      ~~~~~^~
a.cc:19:11: error: lvalue required as left operand of assignment
   19 |   if(A-B-C+D=7){op1='-',op2='-',op3='+';}
      |      ~~~~~^~
a.cc:20:11: error: lvalue required as left operand of assignment
   20 |   if(A-B-C-D=7){op1='-',op2='-',op3='-';}
      |      ~~~~~^~
Language: C++

# coding: utf-8
# Your code here!

def printFormula(x):
    print(nums[0], end = "")
    for i in range(len(nums) - 1):
        if x & (1 << i):
            print("+", end = "")
        else:
            print("-", end = "")
        print(nums[i + 1], end = "")
    print("=7")
        


str1 = input()
nums = []
for i in range(len(str1)):
    nums.append(int(str1[i]))
    
ope = []
for i in range(1 << (len(str1) - 1)):
    sum_num = nums[0]
    
    for j in range(len(str1) - 1):
        if i & (1 << j):
            sum_num += nums[1 + j]
        else:
            sum_num -= nums[1 + j]
        
    if sum_num == 7:
        printFormula(i)
    
    















Compiler output:
a.cc:1:3: error: invalid preprocessing directive #coding
    1 | # coding: utf-8
      |   ^~~~~~
a.cc:2:3: error: invalid preprocessing directive #Your
    2 | # Your code here!
      |   ^~~~
a.cc:4:1: error: 'def' does not name a type
    4 | def printFormula(x):
      | ^~~
Language: C++

# coding: utf-8
# Your code here!



def printStr(i):
    for j in range(3):
        print(nums[j], end = "")
        print(lst[-1][i][j], end = "")
    print(nums[3], end = "")
    print("=7")

str=list(input())
nums = []
for i in range(4):
    nums.append(int(str[i]))

lst = []
tmp = []


for i in range(3):
    if len(lst) == 0:
        tmp = ['+', '-']
        lst.append(tmp)
    else:
        tmp = []
        for j in range(len(lst[-1])):
            tmp.append(lst[-1][j] + "+")
            tmp.append(lst[-1][j] + "-")
        lst.append(tmp)

for i in range(len(lst[-1])):
    result = nums[0]
    for j in range(len(lst[-1][i])):
        
        if lst[-1][i][j] == "+":
            result += nums[j + 1]
        else:
            result -= nums[j + 1]
            
        if j == 2 and result == 7:
            printStr(i)
            exit()
    
        











Compiler output:
a.cc:1:3: error: invalid preprocessing directive #coding
    1 | # coding: utf-8
      |   ^~~~~~
a.cc:2:3: error: invalid preprocessing directive #Your
    2 | # Your code here!
      |   ^~~~
a.cc:6:1: error: 'def' does not name a type
    6 | def printStr(i):
      | ^~~
Language: C++

# coding: utf-8
# Your code here!

class Formula:
    def __init__(self, parent, num, char = None):
        self.num = num
        self.char = char
        self.parent = parent
        

def printStr(i):
    for j in range(3):
        print(nums[j], end = "")
        print(lst[-1][i][j], end = "")
    print(nums[3], end = "")
    print("=7")

str=list(input())
nums = []
for i in range(4):
    nums.append(int(str[i]))

lst = []
tmp = []


for i in range(3):
    if len(lst) == 0:
        tmp = ['+', '-']
        lst.append(tmp)
    else:
        tmp = []
        for j in range(len(lst[-1])):
            tmp.append(lst[-1][j] + "+")
            tmp.append(lst[-1][j] + "-")
        lst.append(tmp)

for i in range(len(lst[-1])):
    result = nums[0]
    for j in range(len(lst[-1][i])):
        
        if lst[-1][i][j] == "+":
            result += nums[j + 1]
        else:
            result -= nums[j + 1]
            
        if j == 2 and result == 7:
            printStr(i)
            exit()
    
        











Compiler output:
a.cc:1:3: error: invalid preprocessing directive #coding
    1 | # coding: utf-8
      |   ^~~~~~
a.cc:2:3: error: invalid preprocessing directive #Your
    2 | # Your code here!
      |   ^~~~
a.cc:5:9: error: expected class-name before '__init__'
    5 |     def __init__(self, parent, num, char = None):
      |         ^~~~~~~~
a.cc:5:9: error: expected '{' before '__init__'
a.cc:5:18: error: 'self' was not declared in this scope
    5 |     def __init__(self, parent, num, char = None):
      |                  ^~~~
a.cc:5:24: error: 'parent' was not declared in this scope
    5 |     def __init__(self, parent, num, char = None):
      |                        ^~~~~~
a.cc:5:32: error: 'num' was not declared in this scope; did you mean 'enum'?
    5 |     def __init__(self, parent, num, char = None):
      |                                ^~~
      |                                enum
a.cc:5:37: error: expected primary-expression before 'char'
    5 |     def __init__(self, parent, num, char = None):
      |                                     ^~~~
a.cc:5:48: error: expression list treated as compound expression in initializer [-fpermissive]
    5 |     def __init__(self, parent, num, char = None):
      |                                                ^
Language: C++

#include <algorithm>
#include <iostream>
#include <set>
#include <vector>
typedef long long ll;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using namespace std;
const int INF = 1 << 30;
const ll INFll = 1ll << 60;

string ans;

int sums(string s) {
  int sum = s[0] - '0';
  for (int i = 1; i <= 5; i += 2) {
    if (s[i] == '-') {
      sum -= s[i + 1] - '0';
    } else {
      sum += s[i + 1] - '0';
    }
  }
  return sum;
}

void sumup7(string s, int i) {
  if (i == 3) {
    if (sums(s) == 7) ans = s + "=7";

    s[5] = '-';
    if (sums(s) == 7) ans = s + "=7";
    s[5] = '+';
    return;
  }

  sumup7(s, i + 1);
  s[2 * i - 1] = '-';
  sumup7(s, i + 1);
  s[2 * i - 1] = '-';
  return;
}

int main() {
  string s(7, '+');
  for (int i = 0; i < 7; i += 2) {
    cin >> s[i];
  }
  sumup7(s, 1);
  cout << ans << endl;

  return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:51:12: error: expected '}' at end of input
   51 |   return 0;
      |            ^
a.cc:43:12: note: to match this '{'
   43 | int main() {
      |            ^
Language: C++

N=input()
n=len(N)-1

for i in range(1<<n):
    ans=N[0]
    for j in range(n):
        if ((i>>j)&1) == 1:
            ans +='+'
            ans +=N[j+1]
        elif ((i>>j)&1) ==0:
            ans+='-'
            ans+=N[j+1]

    if eval(ans)==7:
        temp = ans

temp += '=7'
print(temp)


Compiler output:
a.cc:17:9: warning: multi-character character constant [-Wmultichar]
   17 | temp += '=7'
      |         ^~~~
a.cc:1:1: error: 'N' does not name a type
    1 | N=input()
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string a;
  cin >> a;
  char o =a.at(0) - "0";
  int s= atoi(o);
  vector<int> d;
  d.push_back(s);
  int f;
  int cnt=0;
  for(int i=1;i<4;i++){
    f =d.at(i-1) + a.at(i);
    d.push_back(f);
    f =d.at(i-1) - a.at(i);
    d.push_back(f);
  }
    for(int i=0;i<4;i++){
    f =d.at(i+2) + a.at(3);
    d.push_back(f);
    cnt++;
      if(f == 7)
        break;
    f =d.at(i+3) - a.at(3);
    d.push_back(f);
    cnt++;
      if(f == 7)
        break;
  }
  vector<string> h;
  int r = 3;
  while(r){
    if(cnt % 2 == 1){
      cnt -= 1;
      cnt = cnt /2;
      h.push_back("1");
    }else{
      cnt = cnt /2;
      h.push_back("0");
    }
    r--;
  }
  reverse(h.begin(),h.end());
  string k;
  for(r = 0;r<3;r++){
    k += a.at(r);
    if(h.at(r) == "0")
      k += "+";
    if(h.at(r) == "1")
      k += "-";
  }
  cout << k << a.at(3) << "=7" <<endl;
}
  
  
    

Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'const char [2]' to binary 'operator-'
    6 |   char o =a.at(0) - "0";
      |           ~~~~~~~ ^ ~~~
      |               |     |
      |               |     const char [2]
      |               __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
a.cc:7:15: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
    7 |   int s= atoi(o);
      |               ^
      |               |
      |               char
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string a;
  cin >> a;
  char o =a.at(0);
  int s= atoi(o);
  vector<int> d;
  d.push_back(s);
  int f;
  int cnt=0;
  for(int i=1;i<4;i++){
    f =d.at(i-1) + a.at(i);
    d.push_back(f);
    f =d.at(i-1) - a.at(i);
    d.push_back(f);
  }
    for(int i=0;i<4;i++){
    f =d.at(i+2) + a.at(3);
    d.push_back(f);
    cnt++;
      if(f == 7)
        break;
    f =d.at(i+3) - a.at(3);
    d.push_back(f);
    cnt++;
      if(f == 7)
        break;
  }
  vector<string> h;
  int r = 3;
  while(r){
    if(cnt % 2 == 1){
      cnt -= 1;
      cnt = cnt /2;
      h.push_back("1");
    }else{
      cnt = cnt /2;
      h.push_back("0");
    }
    r--;
  }
  reverse(h.begin(),h.end());
  string k;
  for(r = 0;r<3;r++){
    k += a.at(r);
    if(h.at(r) == "0")
      k += "+";
    if(h.at(r) == "1")
      k += "-";
  }
  cout << k << a.at(3) << "=7" <<endl;
}
  
  
    

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
    7 |   int s= atoi(o);
      |               ^
      |               |
      |               char
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string a;
  cin >> a;
  char o =a.at(0)
  int s= atoi(o);
  vector<int> d;
  d.push_back(s);
  int f;
  int cnt=0;
  for(int i=1;i<4;i++){
    f =d.at(i-1) + a.at(i);
    d.push_back(f);
    f =d.at(i-1) - a.at(i);
    d.push_back(f);
  }
    for(int i=0;i<4;i++){
    f =d.at(i+2) + a.at(3);
    d.push_back(f);
    cnt++;
      if(f == 7)
        break;
    f =d.at(i+3) - a.at(3);
    d.push_back(f);
    cnt++;
      if(f == 7)
        break;
  }
  vector<string> h;
  int r = 3;
  while(r){
    if(cnt % 2 == 1){
      cnt -= 1;
      cnt = cnt /2;
      h.push_back("1");
    }else{
      cnt = cnt /2;
      h.push_back("0");
    }
    r--;
  }
  reverse(h.begin(),h.end());
  string k;
  for(r = 0;r<3;r++){
    k += a.at(r);
    if(h.at(r) == "0")
      k += "+";
    if(h.at(r) == "1")
      k += "-";
  }
  cout << k << a.at(3) << "=7" <<endl;
}
  
  
    

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected ',' or ';' before 'int'
    7 |   int s= atoi(o);
      |   ^~~
a.cc:9:15: error: 's' was not declared in this scope
    9 |   d.push_back(s);
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string a;
  cin >> a;
  int s= atoi(a.at(0));
  vector<int> d;
  d.push_back(s);
  int f;
  int cnt=0;
  for(int i=1;i<4;i++){
    f =d.at(i-1) + a.at(i);
    d.push_back(f);
    f =d.at(i-1) - a.at(i);
    d.push_back(f);
  }
    for(int i=0;i<4;i++){
    f =d.at(i+2) + a.at(3);
    d.push_back(f);
    cnt++;
      if(f == 7)
        break;
    f =d.at(i+3) - a.at(3);
    d.push_back(f);
    cnt++;
      if(f == 7)
        break;
  }
  vector<string> h;
  int r = 3;
  while(r){
    if(cnt % 2 == 1){
      cnt -= 1;
      cnt = cnt /2;
      h.push_back("1");
    }else{
      cnt = cnt /2;
      h.push_back("0");
    }
    r--;
  }
  reverse(h.begin(),h.end());
  string k;
  for(r = 0;r<3;r++){
    k += a.at(r);
    if(h.at(r) == "0")
      k += "+";
    if(h.at(r) == "1")
      k += "-";
  }
  cout << k << a.at(3) << "=7" <<endl;
}
  
  
    

Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
    6 |   int s= atoi(a.at(0));
      |               ~~~~^~~
      |                   |
      |                   __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~