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

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <array>
#include <cstdlib>
#include <map>

using namespace std;

int main(int argc, char const *argv[])
{
	int tmp;
	array<int,4> op_org;
	array<int,4> op;
	multimap<int,bool> ope;
	map<bool,string> ope_res;
	ope_res[true]="+";
	ope_res[false]="-";

	cin >> tmp;

	op_org[0] = tmp/1000;
	tmp -= op_org[0]*1000;
	op_org[1] = tmp/100;
	tmp -= op_org[1]*100;
	op_org[2] = tmp/10;
	tmp -= op_org[2]*10;
	op_org[3] = tmp;

	for (int i = 0; i < 4; ++i)
	{
		op[i] = op_org[i];
	}

	sort(op.begin(),op.end());
	reverse(op.begin(),op.end());

	int res = op[0];
	ope[op[0]]="+";	

	for (int i = 1; i < 4; ++i)
	{
		if(res>7){
			ope[op[i]] = false;
			res -= op[i];
		}
		else{
			ope[op[i]] = true;
			res += op[i];
		}
	}

	cout << op_org[0] << ope_res[ope[op_org[1]]] << op_org[1] << ope_res[ope[op_org[2]]] << op_org[2] << ope_res[ope[op_org[3]]] << op_org[3] << "=7" << "\n"; 

	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:40:12: error: no match for 'operator[]' (operand types are 'std::multimap<int, bool>' and 'std::array<int, 4>::value_type' {aka 'int'})
   40 |         ope[op[0]]="+";
      |            ^
a.cc:45:28: error: no match for 'operator[]' (operand types are 'std::multimap<int, bool>' and 'std::array<int, 4>::value_type' {aka 'int'})
   45 |                         ope[op[i]] = false;
      |                            ^
a.cc:49:28: error: no match for 'operator[]' (operand types are 'std::multimap<int, bool>' and 'std::array<int, 4>::value_type' {aka 'int'})
   49 |                         ope[op[i]] = true;
      |                            ^
a.cc:54:41: error: no match for 'operator[]' (operand types are 'std::multimap<int, bool>' and 'std::array<int, 4>::value_type' {aka 'int'})
   54 |         cout << op_org[0] << ope_res[ope[op_org[1]]] << op_org[1] << ope_res[ope[op_org[2]]] << op_org[2] << ope_res[ope[op_org[3]]] << op_org[3] << "=7" << "\n";
      |                                         ^
a.cc:54:81: error: no match for 'operator[]' (operand types are 'std::multimap<int, bool>' and 'std::array<int, 4>::value_type' {aka 'int'})
   54 |         cout << op_org[0] << ope_res[ope[op_org[1]]] << op_org[1] << ope_res[ope[op_org[2]]] << op_org[2] << ope_res[ope[op_org[3]]] << op_org[3] << "=7" << "\n";
      |                                                                                 ^
a.cc:54:121: error: no match for 'operator[]' (operand types are 'std::multimap<int, bool>' and 'std::array<int, 4>::value_type' {aka 'int'})
   54 |         cout << op_org[0] << ope_res[ope[op_org[1]]] << op_org[1] << ope_res[ope[op_org[2]]] << op_org[2] << ope_res[ope[op_org[3]]] << op_org[3] << "=7" << "\n";
      |                                                                                                                         ^
Language: C++

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
using namespace std;
char s[4];
int main()
{	
	scanf("%s",s);
	int sum=0;
	int l=0;
	char a[10];
	int i,j;
	for(i=0;i<16;i++)
	{
		sum=0;
		memset(a,0,sizeof(a));
		//itoa(i,a,2);
		for(j=0;j<4;j++)
		{
			if(i & (1 << j))
			sum+=s[j]-'0';
			else
			sum-=s[j]-'0';
		}
		if(sum==7)
		{
			l=i;
			break;
		}
	}
	itoa(l,a,2);
	
	for(i=0;i<4;i++)
	{	
		if(l & (1 << i)){
			if(i != 0){
				printf("+");
			}
		}
		else
			printf("-");
		//printf("%c",a[0]);
		printf("%c",s[i]);
	}
	printf("=7\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:9: error: 'itoa' was not declared in this scope
   31 |         itoa(l,a,2);
      |         ^~~~
Language: C++

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
using namespace std;
char s[4];
int main()
{	
	scanf("%s",s);
	int sum=0;
	int l=0;
	char a[10];
	int i,j;
	for(i=0;i<16;i++)
	{
		sum=0;
		memset(a,0,sizeof(a));
		itoa(i,a,2);
		for(j=0;j<4;j++)
		{
			if(a[j]=='1')
			sum+=s[j]-'0';
			else
			sum-=s[j]-'0';
		}
		if(sum==7)
		{
			l=i;
			break;
		}
	}
	itoa(l,a,2);
	for(i=0;i<4;i++)
	{	
		if(i!=0)
		{
			if(a[i]=='1')
			printf("+");
			else
			printf("-");
		}
		if(a[0]=='-')
		printf("%c",a[0]);
		printf("%c",s[i]);
	}
	printf("=7\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'itoa' was not declared in this scope
   17 |                 itoa(i,a,2);
      |                 ^~~~
a.cc:31:9: error: 'itoa' was not declared in this scope
   31 |         itoa(l,a,2);
      |         ^~~~
Language: C++

#include<stdio.h>
#include<string.h>
#include<queue>
#include<stdlib.h>
using namespace std;
char s[4];
int main()
{	
	scanf("%s",s);
	int sum=0;
	int l=0;
	char a[10];
	int i,j;
	for(i=0;i<16;i++)
	{
		sum=0;
		memset(a,0,sizeof(a));
		itoa(i,a,2);
		for(j=0;j<4;j++)
		{
			if(a[j]=='1')
			sum+=s[j]-'0';
			else
			sum-=s[j]-'0';
		}
		if(sum==7)
		{
			l=i;
			break;
		}
	}
	itoa(l,a,2);
	for( i=0;i<4;i++)
	{	
		if(i!=0)
		{
			if(a[i]=='1')
			printf("+");
			else
			printf("-");
		}
		if(a[0]=='-')
		printf("%c",a[0]);
		printf("%c",s[i]);
	}
	printf("=7\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'itoa' was not declared in this scope
   18 |                 itoa(i,a,2);
      |                 ^~~~
a.cc:32:9: error: 'itoa' was not declared in this scope
   32 |         itoa(l,a,2);
      |         ^~~~
Language: C++

#include<iostream>
#include<string>
#include<iostream>
#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
int main() {
string a;
cin>>a;
int b,c,d,e;
b=a[0]-'0';
c=a[1]-'0';
d=a[2]-'0';
e=a[3]-'0';
int ans=0;
if(b+c+d+e==7)printf("%d+%d+%d+%d=7",b,c,d,e);
//
else if(b+c+d-e==7)printf("%d+%d+%d-%d=7",b,c,d,e);
else if(b+c+e-d==7)printf("%d+%d+%d-%d=7",b,c,e,d);
else if(b-c+d+e==7)printf("%d-%d+%d+%d=7",b,c,d,e);
else if(c-b+d+e==7)printf("%d-%d+%d+%d=7",c,b,d,e);
//
else if(b+c-d-e==7)printf("%d+%d-%d-%d=7",b,c,d,e);
else if(b+d-c-e==7)printf("%d+%d-%d-%d=7",b,d,c,e);
else if(b+e-c-d==7)printf("%d+%d-%d-%d=7",b,e,c,d);
else if(c+d-b-e==7)printf("%d+%d-%d-%d=7",c,d,b,e);
else if(c+e-b-d==7)printf("%d+%d-%d-%d=7",c,e,b,d);
else if(d+e-b-c==7)printf("%d+%d-%d-%d=7",d,e,b,c);
//
else if(b-c-d-e==7)printf("%d-%d-%d-%d=7",b,c,d,e);
else if(c-b-d-e==7)printf("%d-%d-%d-%d=7",c,b,d,e);
else if(d-b-c-e==7)printf("%d-%d-%d-%d=7",d,b,c,e);
else if(e-b-c-d==7)printf("%d-%d-%d-%d=7",e,b,c,d);
//

else if(-b-c-d-e==7)printf("-%d-%d-%d-%d=7",b,c,d,e);
else if(d-b-c-e==7)printf("%d-%d-%d-%d=7",d,b,c,e);
else if(c-b-d-e==7)printf("%d-%d-%d-%d=7",c,b,d,e);
else if(b-c-d-e==7)printf("%d-%d-%d-%d=7",b,c,d,e);*/
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:53: error: expected primary-expression before '/' token
   39 | else if(b-c-d-e==7)printf("%d-%d-%d-%d=7",b,c,d,e);*/
      |                                                     ^
a.cc:40:1: error: expected primary-expression before '}' token
   40 | }
      | ^
Language: C++

#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;

int main()
{
	int a, b, c, d;
	while(~scanf("%1d%1d%1d%1d", &a, &b, &c, &d))
	{
		if(a + b + c + d == 7)
			{printf("%d+%d+%d+%d=7\n", a, b, c, d);break;}
		if(a + b + c - d == 7)
			{printf("%d+%d+%d-%d=7\n", a, b, c, d);break;}
		if(a + b - c + d == 7)
			{printf("%d+%d-%d+%d=7\n", a, b, c, d);break}
		if(a - b + c + d == 7)
			{printf("%d-%d+%d+%d=7\n", a, b, c, d);break;}
		if(a + b - c - d == 7)
			{printf("%d+%d-%d-%d=7\n", a, b, c, d);break;}
		if(a - b - c + d == 7)
			{printf("%d-%d-%d+%d=7\n", a, b, c, d);break;}
		if(a - b + c - d == 7)
			{printf("%d-%d+%d-%d=7\n", a, b, c, d);break;}
		if(a - b - c - d == 7)
			{printf("%d-%d-%d-%d=7\n", a, b, c, d);break;}
	    
	}
}



Compiler output:
a.cc: In function 'int main()':
a.cc:17:69: error: expected ';' before '}' token
   17 |                         {printf("%d+%d-%d+%d=7\n", a, b, c, d);break}
      |                                                                     ^
      |                                                                     ;
Language: C++

#include<stdio.h>
#include<string.h>
#include<queue>
#include<stdlib.h>
using namespace std;
char s[4];
int main()
{	
	scanf("%s",s);
	int sum=0;
	int l=0;
	char a[10];
	for(int i=0;i<16;i++)
	{
		sum=0;
		memset(a,0,sizeof(a));
		itoa(i,a,2);
		for(int j=0;j<4;j++)
		{
			if(a[j]=='1')
			sum+=s[j]-'0';
			else
			sum-=s[j]-'0';
		}
		if(sum==7)
		{
			l=i;
			break;
		}
	}
	itoa(l,a,2);
	for(int i=0;i<4;i++)
	{	
		if(i!=0)
		{
			if(a[i]=='1')
			printf("+");
			else
			printf("-");
		}
		if(a[0]=='-')
		printf("%c",a[0]);
		printf("%c",s[i]);
	}
	printf("=7\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'itoa' was not declared in this scope
   17 |                 itoa(i,a,2);
      |                 ^~~~
a.cc:31:9: error: 'itoa' was not declared in this scope
   31 |         itoa(l,a,2);
      |         ^~~~
Language: C

#include <stdio.h>
 
int main(){
int a =getchar();
 int b = getchar();
 int c =getchar();
 int d =getchar();
 if((a+b+c+d)==199){
   printf("%d+%d+%d+%d=7",a-48,b-48,c-48,d-48);
   }
 else if((a-b+c+d)==199){
   printf("%d-%d+%d+%d=7",a-48,b-48,c-48,d-48);
 }
 else if((a+b-c+d==)199){
   printf("%d+%d-%d+%d=7",a-48,b-48,c-48,d-48);
 }else if((a+b+c-d)==199){
   printf("%d+%d+%d-%d=7",a-48,b-48,c-48,d-48);
 }else if((a-b-c+d)==199){
   printf("%d-%d-%d+%d=7",a-48,b-48,c-48,d-48);
 }else if((a-b+c-d)==199){
   printf("%d-%d+%d-%d=7",a-48,b-48,c-48,d-48);
 }else if((a+b-c-d)==199){
   printf("%d+%d-%d-%d=7",a-48,b-48,c-48,d-48);
 }else if((a-b-c-d_==199){
   printf("%d-%d-%d-%d=7",a-48,b-48,c-48,d-48);
 }//aaa

return 0;
}


Compiler output:
main.c: In function 'main':
main.c:14:20: error: expected expression before ')' token
   14 |  else if((a+b-c+d==)199){
      |                    ^
main.c:24:18: error: 'd_' undeclared (first use in this function); did you mean 'd'?
   24 |  }else if((a-b-c-d_==199){
      |                  ^~
      |                  d
main.c:24:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:24:26: error: expected ')' before '{' token
   24 |  }else if((a-b-c-d_==199){
      |          ~               ^
      |                          )
main.c:29:1: error: expected expression before '}' token
   29 | }
      | ^
Language: C++

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
using namespace std;
int main()
{	
        char s[4];
	scanf("%s",s);
	int sum=0;
	int l=0;
	char a[10];
	for(int i=0;i<16;i++)
	{
		sum=0;
		memset(a,0,sizeof(a));
		itoa(i,a,2);
		for(int i=0;i<4;i++)
		{
			if(a[i]=='1')
			sum+=s[i]-'0';
			else
			sum-=s[i]-'0';
		}
		if(sum==7)
		{
			l=i;
			break;
		}
	}
	itoa(l,a,2);
	for(int i=0;i<4;i++)
	{	
		if(i!=0)
		{
			if(a[i]=='1')
			printf("+");
			else
			printf("-");
		}
		if(a[0]=='-')
		printf("%c",a[0]);
		printf("%c",s[i]);
	}
	printf("=7\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: 'itoa' was not declared in this scope
   16 |                 itoa(i,a,2);
      |                 ^~~~
a.cc:30:9: error: 'itoa' was not declared in this scope
   30 |         itoa(l,a,2);
      |         ^~~~
Language: C++

#include<stdio.h>
#include<string.h>
#include<queue>
#include<stdlib.h>
using namespace std;
char s[4];
int main()
{	
	scanf("%s",s);
	int sum=0;
	int l=0;
	char a[10];
	for(int i=0;i<16;i++)
	{
		sum=0;
		memset(a,0,sizeof(a));
		itoa(i,a,2);
		for(int i=0;i<4;i++)
		{
			if(a[i]=='1')
			sum+=s[i]-'0';
			else
			sum-=s[i]-'0';
		}
		if(sum==7)
		{
			l=i;
			break;
		}
	}
	itoa(l,a,2);
	for(int i=0;i<4;i++)
	{	
		if(i!=0)
		{
			if(a[i]=='1')
			printf("+");
			else
			printf("-");
		}
		if(a[0]=='-')
		printf("%c",a[0]);
		printf("%c",s[i]);
	}
	printf("=7\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'itoa' was not declared in this scope
   17 |                 itoa(i,a,2);
      |                 ^~~~
a.cc:31:9: error: 'itoa' was not declared in this scope
   31 |         itoa(l,a,2);
      |         ^~~~
Language: C++

#include<cstdio>

int main(){
     int n,a,b,c,d;
     while(~scanf("%d",&n)){
     a=n/1000;
     b=(n/100)%10;
     c=(n%100)/10;
     d=n%10;
    if((a+b+c+d)==7)    	
		printf("%d+%d+%d+%d=%d",a,b,c,d,a+b+c+d);
    else if((a+b+c-d)==7)
    	printf("%d+%d+%d-%d=%d",a,b,c,d,a+b+c-d);
	else if((a+b-c-d)==7)
		printf("%d+%d-%d-%d=%d",a,b,c,d,a+b-c-d);
    else if((a-b-c-d)==7)
    	printf("%d-%d-%d-%d=%d",a,b,c,d,a-b-c-d);
    else if((a-b+c+d)==7)
    	printf("%d-%d+%d+%d=%d",a,b,c,d,a-b+c+d);
    else if((a+b-c+d)=7)
    	printf("%d+%d+%d-%d=%d",a,b,c,d,a+b-c+d);
    	return 0;
		}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:19: error: lvalue required as left operand of assignment
   20 |     else if((a+b-c+d)=7)
      |             ~~~~~~^~~
a.cc:23:18: error: expected '}' at end of input
   23 |                 }
      |                  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

int main(){
   int A,B,C,D;
  cin >> A >> B >> C >> D;	
	if(A+B+C+D==7){
	cout <<A ;
	cout <<"+" ;
	cout <<B ;
	cout <<"+" ;
	cout <<C ;
	cout <<"+" ;
	cout <<D ;
	cout <<"=" ;
	cout <<"7" ;
}	else if(A+B+C-D==7){
	cout <<A ;
	cout <<"+" ;
	cout <<B ;
	cout <<"+" ;
	cout <<C ;
	cout <<"-" ;
	cout <<D ;
	cout <<"=" ;
	cout <<"7" ;
}	else if(A+B-C+D==7){
	cout <<A ;
	cout <<"+" ;
	cout <<B ;
	cout <<"-" ;
	cout <<C ;
	cout <<"+" ;
	cout <<D ;
	cout <<"=" ;
	cout <<"7" ;
}	else if(A-B+C+D==7){
	cout <<A ;
	cout <<"-" ;
	cout <<B ;
	cout <<"+" ;
	cout <<C ;
	cout <<"+" ;
	cout <<D ;
	cout <<"=" ;
	cout <<"7" ;
}	else if(A+B-C-D==7){
	cout <<A ;
	cout <<"+" ;
	cout <<B ;
	cout <<"-" ;
	cout <<C ;
	cout <<"-" ;
	cout <<D ;
	cout <<"=" ;
	cout <<"7" ;
}	else if(A-B+C-D==7){
	cout <<A ;
	cout <<"-" ;
	cout <<B ;
	cout <<"+" ;
	cout <<C ;
	cout <<"-" ;
	cout <<D ;
	cout <<"=" ;
	cout <<"7" ;
}	else if(A-B-C+D==7){
	cout <<A ;
	cout <<"-" ;
	cout <<B ;
	cout <<"-" ;
	cout <<C ;
	cout <<"+" ;
	cout <<D ;
	cout <<"=" ;
	cout <<"7" ;
}	else if(A-B-C-D==7){
	cout <<A ;
	cout <<"-" ;
	cout <<B ;
	cout <<"-" ;
	cout <<C ;
	cout <<"-" ;
	cout <<D ;
	cout <<"=" ;
	cout <<"7" ;
}
 return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin >> A >> B >> C >> D;
      |   ^~~
a.cc:5:9: error: 'cout' was not declared in this scope
    5 |         cout <<A ;
      |         ^~~~
a.cc:15:9: error: 'cout' was not declared in this scope
   15 |         cout <<A ;
      |         ^~~~
a.cc:25:9: error: 'cout' was not declared in this scope
   25 |         cout <<A ;
      |         ^~~~
a.cc:35:9: error: 'cout' was not declared in this scope
   35 |         cout <<A ;
      |         ^~~~
a.cc:45:9: error: 'cout' was not declared in this scope
   45 |         cout <<A ;
      |         ^~~~
a.cc:55:9: error: 'cout' was not declared in this scope
   55 |         cout <<A ;
      |         ^~~~
a.cc:65:9: error: 'cout' was not declared in this scope
   65 |         cout <<A ;
      |         ^~~~
a.cc:75:9: error: 'cout' was not declared in this scope
   75 |         cout <<A ;
      |         ^~~~
Language: C++

int main(){
   int A,B,C,D;
  cin >> A >> B >> C >> D;	
	if(A+B+C+D==7){
	cout << A ;
	cout << "+" ;
	cout << B ;
	cout << "+" ;
	cout << C ;
	cout << "+" ;
	cout << D ;
	cout << "=" ;
	cout << "7" ;
}	else if(A+B+C-D==7){
	cout << A ;
	cout << "+" ;
	cout << B ;
	cout << "+" ;
	cout << C ;
	cout << "-" ;
	cout << D ;
	cout << "=" ;
	cout << "7" ;
}	else if(A+B-C+D==7){
	cout << A ;
	cout << "+" ;
	cout << B ;
	cout << "-" ;
	cout << C ;
	cout << "+" ;
	cout << D ;
	cout << "=" ;
	cout << "7" ;
}	else if(A-B+C+D==7){
	cout << A ;
	cout << "-" ;
	cout << B ;
	cout << "+" ;
	cout << C ;
	cout << "+" ;
	cout << D ;
	cout << "=" ;
	cout << "7" ;
}	else if(A+B-C-D==7){
	cout << A ;
	cout << "+" ;
	cout << B ;
	cout << "-" ;
	cout << C ;
	cout << "-" ;
	cout << D ;
	cout << "=" ;
	cout << "7" ;
}	else if(A-B+C-D==7){
	cout << A ;
	cout << "-" ;
	cout << B ;
	cout << "+" ;
	cout << C ;
	cout << "-" ;
	cout << D ;
	cout << "=" ;
	cout << "7" ;
}	else if(A-B-C+D==7){
	cout << A ;
	cout << "-" ;
	cout << B ;
	cout << "-" ;
	cout << C ;
	cout << "+" ;
	cout << D ;
	cout << "=" ;
	cout << "7" ;
}	else if(A-B-C-D==7){
	cout << A ;
	cout << "-" ;
	cout << B ;
	cout << "-" ;
	cout << C ;
	cout << "-" ;
	cout << D ;
	cout << "=" ;
	cout << "7" ;
}
 return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin >> A >> B >> C >> D;
      |   ^~~
a.cc:5:9: error: 'cout' was not declared in this scope
    5 |         cout << A ;
      |         ^~~~
a.cc:15:9: error: 'cout' was not declared in this scope
   15 |         cout << A ;
      |         ^~~~
a.cc:25:9: error: 'cout' was not declared in this scope
   25 |         cout << A ;
      |         ^~~~
a.cc:35:9: error: 'cout' was not declared in this scope
   35 |         cout << A ;
      |         ^~~~
a.cc:45:9: error: 'cout' was not declared in this scope
   45 |         cout << A ;
      |         ^~~~
a.cc:55:9: error: 'cout' was not declared in this scope
   55 |         cout << A ;
      |         ^~~~
a.cc:65:9: error: 'cout' was not declared in this scope
   65 |         cout << A ;
      |         ^~~~
a.cc:75:9: error: 'cout' was not declared in this scope
   75 |         cout << A ;
      |         ^~~~
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){
	cout << A ;
	cout << "+" ;
	cout << B ;
	cout << "+" ;
	cout << C ;
	cout << "+" ;
	cout << D ;
	cout << "=" ;
	cout << "7" ;
}	else if(A+B+C-D==7){
	cout << A << ;
	cout << "+" ;
	cout << B ;
	cout << "+" ;
	cout << C ;
	cout << "-" ;
	cout << D ;
	cout << "=" ;
	cout << "7" ;
}	else if(A+B-C+D==7){
	cout << A ;
	cout << "+" ;
	cout << B ;
	cout << "-" ;
	cout << C ;
	cout << "+" ;
	cout << D ;
	cout << "=" ;
	cout << "7" ;
}	else if(A-B+C+D==7){
	cout << A ;
	cout << "-" ;
	cout << B ;
	cout << "+" ;
	cout << C ;
	cout << "+" ;
	cout << D ;
	cout << "=" ;
	cout << "7" ;
}	else if(A+B-C-D==7){
	cout << A ;
	cout << "+" ;
	cout << B ;
	cout << "-" ;
	cout << C ;
	cout << "-" ;
	cout << D ;
	cout << "=" ;
	cout << "7" ;
}	else if(A-B+C-D==7){
	cout << A ;
	cout << "-" ;
	cout << B ;
	cout << "+" ;
	cout << C ;
	cout << "-" ;
	cout << D ;
	cout << "=" ;
	cout << "7" ;
}	else if(A-B-C+D==7){
	cout << A ;
	cout << "-" ;
	cout << B ;
	cout << "-" ;
	cout << C ;
	cout << "+" ;
	cout << D ;
	cout << "=" ;
	cout << "7" ;
}	else if(A-B-C-D==7){
	cout << A ;
	cout << "-" ;
	cout << B ;
	cout << "-" ;
	cout << C ;
	cout << "-" ;
	cout << D ;
	cout << "=" ;
	cout << "7" ;
}
 return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:18:22: error: expected primary-expression before ';' token
   18 |         cout << A << ;
      |                      ^
Language: C

#include<stdio.h>
#include<stdlib.h>
using namespace std;

int add(int a, int b);
int minu(int a, int b);

int main()
{
	char a, b, c, d;
	int e, f, g, h;
	
	scanf("%c", &a);
	scanf("%c", &b);
	scanf("%c", &c);
	scanf("%c", &d);


	e = atoi(&a);
	f = atoi(&b);
	g = atoi(&c);
	h = atoi(&d);

	if (add(add(add(e, f), g), h) == 7)
	{
		printf("%d", e);
		printf("%s", "+");
		printf("%d", f);
		printf("%s", "+");
		printf("%d", g);
		printf("%s", "+");
		printf("%d", h);
		printf("%s", "=7");
		//cout << e << "+" << f << "+" << g << "+" << h<<"=7";
	}
	else if (minu(add(add(e, f), g), h) == 7)
	{
		printf("%d", e);
		printf("%s", "+");
		printf("%d", f);
		printf("%s", "+");
		printf("%d", g);
		printf("%s", "-");
		printf("%d", h);
		printf("%s", "=7");
		//cout << e << "+" << f << "+" << g << "-" << h << "=7";
	}
	else if (add(minu(add(e, f), g), h) == 7)
	{
		printf("%d", e);
		printf("%s", "+");
		printf("%d", f);
		printf("%s", "-");
		printf("%d", g);
		printf("%s", "+");
		printf("%d", h);
		printf("%s", "=7");
		//cout << e << "+" << f << "-" << g << "+" << h << "=7";
	}
	else if (minu(minu(add(e, f), g), h) == 7)
	{
		printf("%d", e);
		printf("%s", "+");
		printf("%d", f);
		printf("%s", "-");
		printf("%d", g);
		printf("%s", "-");
		printf("%d", h);
		printf("%s", "=7");
		//cout << e << "+" << f << "-" << g << "-" << h << "=7";
	}
	else if (add(add(minu(e, f), g), h) == 7)
	{
		printf("%d", e);
		printf("%s", "-");
		printf("%d", f);
		printf("%s", "+");
		printf("%d", g);
		printf("%s", "+");
		printf("%d", h);
		printf("%s", "=7");
		//cout << e << "-" << f << "+" << g << "+" << h << "=7";
	}
	else if (minu(add(minu(e, f), g), h) == 7)
	{
		printf("%d", e);
		printf("%s", "-");
		printf("%d", f);
		printf("%s", "+");
		printf("%d", g);
		printf("%s", "-");
		printf("%d", h);
		printf("%s", "=7");
		//cout << e << "-" << f << "+" << g << "-" << h << "=7";
	}
	else if (add(minu(minu(e, f), g), h) == 7)
	{
		printf("%d", e);
		printf("%s", "-");
		printf("%d", f);
		printf("%s", "-");
		printf("%d", g);
		printf("%s", "+");
		printf("%d", h);
		printf("%s", "=7");
		//cout << e << "-" << f << "-" << g << "+" << h << "=7";
	}
	else if (minu(minu(minu(e, f), g), h) == 7)
	{
		printf("%d", e);
		printf("%s", "-");
		printf("%d", f);
		printf("%s", "-");
		printf("%d", g);
		printf("%s", "-");
		printf("%d", h);
		printf("%s", "=7");
		//cout << e << "-" << f << "-" << g << "-" << h << "=7";
	}



	return 0;
}

int add(int a, int b)
{
	return a + b;
}

int minu(int a, int b)
{
	return a - b;
}




Compiler output:
main.c:3:1: error: unknown type name 'using'
    3 | using namespace std;
      | ^~~~~
main.c:3:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    3 | using namespace std;
      |                 ^~~
Language: C

#include<stdio.h>
#include<stdlib.h>
using namespace std;

int add(int a, int b);
int minu(int a, int b);

int main()
{
	char a, b, c, d;
	int e, f, g, h;
	
	scanf("%c", &a);
	scanf("%c", &b);
	scanf("%c", &c);
	scanf("%c", &d);


	e = atoi(&a);
	f = atoi(&b);
	g = atoi(&c);
	h = atoi(&d);

	if (add(add(add(e, f), g), h) == 7)
	{
		printf("%d", e);
		printf("%d", "+");
		printf("%d", f);
		printf("%d", "+");
		printf("%d", g);
		printf("%d", "+");
		printf("%d", h);
		printf("%d", "=7");
		//cout << e << "+" << f << "+" << g << "+" << h<<"=7";
	}
	else if (minu(add(add(e, f), g), h) == 7)
	{
		printf("%d", e);
		printf("%d", "+");
		printf("%d", f);
		printf("%d", "+");
		printf("%d", g);
		printf("%d", "-");
		printf("%d", h);
		printf("%d", "=7");
		//cout << e << "+" << f << "+" << g << "-" << h << "=7";
	}
	else if (add(minu(add(e, f), g), h) == 7)
	{
		printf("%d", e);
		printf("%d", "+");
		printf("%d", f);
		printf("%d", "-");
		printf("%d", g);
		printf("%d", "+");
		printf("%d", h);
		printf("%d", "=7");
		//cout << e << "+" << f << "-" << g << "+" << h << "=7";
	}
	else if (minu(minu(add(e, f), g), h) == 7)
	{
		printf("%d", e);
		printf("%d", "+");
		printf("%d", f);
		printf("%d", "-");
		printf("%d", g);
		printf("%d", "-");
		printf("%d", h);
		printf("%d", "=7");
		//cout << e << "+" << f << "-" << g << "-" << h << "=7";
	}
	else if (add(add(minu(e, f), g), h) == 7)
	{
		printf("%d", e);
		printf("%d", "-");
		printf("%d", f);
		printf("%d", "+");
		printf("%d", g);
		printf("%d", "+");
		printf("%d", h);
		printf("%d", "=7");
		//cout << e << "-" << f << "+" << g << "+" << h << "=7";
	}
	else if (minu(add(minu(e, f), g), h) == 7)
	{
		printf("%d", e);
		printf("%d", "-");
		printf("%d", f);
		printf("%d", "+");
		printf("%d", g);
		printf("%d", "-");
		printf("%d", h);
		printf("%d", "=7");
		//cout << e << "-" << f << "+" << g << "-" << h << "=7";
	}
	else if (add(minu(minu(e, f), g), h) == 7)
	{
		printf("%d", e);
		printf("%d", "-");
		printf("%d", f);
		printf("%d", "-");
		printf("%d", g);
		printf("%d", "+");
		printf("%d", h);
		printf("%d", "=7");
		//cout << e << "-" << f << "-" << g << "+" << h << "=7";
	}
	else if (minu(minu(minu(e, f), g), h) == 7)
	{
		printf("%d", e);
		printf("%d", "-");
		printf("%d", f);
		printf("%d", "-");
		printf("%d", g);
		printf("%d", "-");
		printf("%d", h);
		printf("%d", "=7");
		//cout << e << "-" << f << "-" << g << "-" << h << "=7";
	}



	return 0;
}

int add(int a, int b)
{
	return a + b;
}

int minu(int a, int b)
{
	return a - b;
}




Compiler output:
main.c:3:1: error: unknown type name 'using'
    3 | using namespace std;
      | ^~~~~
main.c:3:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    3 | using namespace std;
      |                 ^~~
Language: C++

#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	char a,b,c,d;
	int A,B,C,D;
	scanf("%c%c%c%c",&a,&b,&c,&d);
	A=a-48;
	B=b-48;
	C=c-48;
	D=d-48;
//	printf("%d",A);
	if(A+B+C+D==7){
		printf("%d%c%d%c%d%c%d%c%d\n",A,'+',B,'+',C,'+',D,'=',7);
		break;}
	if(A+B+C-D==7){
		printf("%d%c%d%c%d%c%d%c%d\n",A,'+',B,'+',C,'-',D,'=',7);
		break;
	}
	if(A+B-C+B==7){
		printf("%d%c%d%c%d%c%d%c%d\n",A,'+',B,'-',C,'+',D,'=',7);
		break;
	}
	if(A+B-C-B==7){
		printf("%d%c%d%c%d%c%d%c%d\n",A,'+',B,'-',C,'-',D,'=',7);
		break;
	}
	if(A-B+C+B==7){
		printf("%d%c%d%c%d%c%d%c%d\n",A,'-',B,'+',C,'+',D,'=',7);
		break;
	}
	if(A-B+C+B==7){
		printf("%d%c%d%c%d%c%d%c%d\n",A,'-',B,'+',C,'-',D,'=',7);
		break;
		}
	if(A-B-C+B==7){
		printf("%d%c%d%c%d%c%d%c%d\n",A,'-',B,'-',C,'+',D,'=',7);
		break;
	}
	if(A-B-C-B==7)
	{
		printf("%d%c%d%c%d%c%d%c%d\n",A,'-',B,'-',C,'-',D,'=',7);
		break;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: break statement not within loop or switch
   19 |                 break;}
      |                 ^~~~~
a.cc:22:17: error: break statement not within loop or switch
   22 |                 break;
      |                 ^~~~~
a.cc:26:17: error: break statement not within loop or switch
   26 |                 break;
      |                 ^~~~~
a.cc:30:17: error: break statement not within loop or switch
   30 |                 break;
      |                 ^~~~~
a.cc:34:17: error: break statement not within loop or switch
   34 |                 break;
      |                 ^~~~~
a.cc:38:17: error: break statement not within loop or switch
   38 |                 break;
      |                 ^~~~~
a.cc:42:17: error: break statement not within loop or switch
   42 |                 break;
      |                 ^~~~~
a.cc:47:17: error: break statement not within loop or switch
   47 |                 break;
      |                 ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <string>

std::vector<int> parse(int inp) {
  std::vector<int> out(4);
  for(auto &x : out) {
    x = inp % 10;
    inp /= 10;
  }
  std::reverse(out.begin(), out.end());
  return out;
}

class Op
{
public:
  int id;
  Op(int inp_id) {
    id = inp_id > 0 ? 1 : 0;
  }

  Op(){
    id = 0;
  }

  static std::string get_p(Op p) {
    if(p.id == 0) return "+";
    return "-";
  }

  int act(int left, int right) {
    if(id == 0) return left + right;
    return left - right;
  }
};

  std::ostream& operator<< (std::ostream& os, const Op& o) {
    os << Op::get_p(o.id);
    return os;
  }

bool check_seven(std::vector<int> a, std::vector<Op> o) {
  int sum = a[0];
  for(int i = 0; i < 3; i++) {
    sum = o[i].act(sum , a[i + 1]);
  }
  std::cout << sum << std::endl;
  return sum == 7;
}

void parse_op(int pattern, std::vector<Op> &op) {
  for(int i = 0; i < 3; i++) {
    op[i].id = (pattern & (1 << i)) ? 1 : 0;
  }
}

int main(void) {
  int inp;
  std::cin >> inp;
  std::vector<int> abcd = parse(inp);
  std::vector<Op> op(3);

  for(int i = 0;i < 8; i++) {
    parse_op(i, op);
    if(check_seven(abcd, op)) break;
  }

  for(int i = 0; i < 3; i++) {
    std::cout << abcd[i] << op[i];
  }
  std::cout << abcd[3] << "=7" << std::endl;
  return 0;
}


Compiler output:
a.cc: In function 'std::vector<int> parse(int)':
a.cc:11:8: error: 'reverse' is not a member of 'std'
   11 |   std::reverse(out.begin(), out.end());
      |        ^~~~~~~
Language: C++

	else if(A+B+C+D==7){
	cout << A << ;
	cout << "+" << ;
	cout << B << ;
	cout << "+" << ;
	cout << C << ;
	cout << "+" << ;
	cout << D << ;
	cout << "=" << ;
	cout << "7" << ;
}

Compiler output:
a.cc:1:9: error: expected unqualified-id before 'else'
    1 |         else if(A+B+C+D==7){
      |         ^~~~
Language: C++

#include<iostream>
#include<string>
#include<iostream>
#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
int main() {
string a;
cin>>a;
int b,c,d,e;
b=a[0]-'0';
c=a[1]-'0';
d=a[2]-'0';
e=a[3]-'0';
int ans=0;
if(b+c+d+e==7)printf("%d+%d+%d+%d=7",b,c,d,e);
else if(b+c+d-e==7))printf("%d+%d+%d-%d=7",b,c,d,e);
else if(b+c+e-d==7)printf("%d-%d+%d-%d=7",b,c,e,d);
else if(b-c+d+e==7)printf("%d-%d+%d+%d=7",b,c,d,e);
else if(-b+c+d+e==7)printf("%d-%d+%d+%d=7",c,b,d,e);
else if(b+c-d-e==7)printf("%d+%d-%d-%d=7",b,c,d,e);
else if(b+d-c-e==7)printf("%d+%d-%d-%d=7",b,d,c,e);
else if(b+e-c-d==7)printf("%d+%d-%d-%d=7",b,e,c,d);
else if(c+d-b-e==7)printf("%d+%d-%d-%d=7",c,d,b,e);
else if(c+e-b-d==7)printf("%d-%d-%d-%d=7",c,e,b,d);
else if(d+e-b-c==7)printf("%d+%d-%d-%d=7",d,e,b,c);
else if(b-c-d-e==7)printf("%d-%d-%d-%d=7",b,c,d,e);
else if(c-b-d-e==7)printf("%d-%d-%d-%d=7",c,b,d,e);
else if(d-b-c-e==7)printf("%d-%d-%d-%d=7",d,b,c,e);
else if(e-b-c-d==7)printf("%d-%d-%d-%d=7",e,b,c,d);
else if(d-b-c-e==7)printf("%d-%d-%d-%d=7",d,b,c,e);
else if(c-b-d-e==7)printf("%d-%d-%-+%d=7",c,b,d,e);
else if(b-c-d-e==7)printf("%d-%d-%d-%d=7",b,c,d,e);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:20: error: expected primary-expression before ')' token
   17 | else if(b+c+d-e==7))printf("%d+%d+%d-%d=7",b,c,d,e);
      |                    ^
Language: Java

import java.util.Scanner;

public class Demo22 {

	public static void Main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int num1 = num/1000;
		int num2 = num%1000/100;
		int num3 = num%100/10;
		int num4 = num%10;
		String[] str =new String[]{"+","-"};
		
		int temp1 = num1 + num2;
		int temp2 = num1-num2;
		
		int temp3 = temp1 + num3;
		int temp4 = temp1 - num3;
		int temp5 = temp2 + num3;
		int temp6 = temp2 - num3;
		
		int temp7 = temp3 + num4;
		int temp8 = temp3 - num4;
		int temp9 = temp4 + num4;
		int temp10 = temp4 - num4;
		int temp11 = temp5 + num4;
		int temp12 = temp5 - num4;
		int temp13 = temp6 + num4;
		int temp14 = temp6 - num4;
		
		if(temp7 == 7){
			System.out.println(num1 +"+"+ num2+"+"+num3 +"+"+ num4+"=7");
		}else if(temp8 == 7){
			System.out.println(num1 +"+"+ num2+"+"+num3 +"-"+ num4+"=7");
		}else if(temp9 == 7){
			System.out.println(num1 +"+"+ num2+"-"+num3 +"+"+ num4+"=7");
		}else if(temp10 == 7){
			System.out.println(num1 +"+"+ num2+"-"+num3 +"-"+ num4+"=7");
		}else if(temp11 == 7){
			System.out.println(num1 +"-"+ num2+"+"+num3 +"+"+ num4+"=7");
		}else if(temp12 == 7){
			System.out.println(num1 +"-"+ num2+"+"+num3 +"-"+ num4+"=7");
		}else if(temp13 == 7){
			System.out.println(num1 +"-"+ num2+"-"+num3 +"+"+ num4+"=7");
		}else if(temp14 == 7){
			System.out.println(num1 +"-"+ num2+"-"+num3 +"-"+ num4+"=7");
		}
		
		
	}

}

Compiler output:
Main.java:3: error: class Demo22 is public, should be declared in a file named Demo22.java
public class Demo22 {
       ^
1 error
Language: Java

public class T03 {
    public static void main(String args[]) {
        java.util.Scanner sc = new java.util.Scanner(System.in);
        int num = sc.nextInt();
        int[] A = new int[4];
        for (int i = 0; i < 4; i++) {
            A[3-i] = num % 10;
            num /= 10;
        }

        for (int i = 0; i < 8; i++) {
            int tmp = i + 1;
            int ans = A[0];
            for (int j = 1; j < 4; j++) {
                if (tmp % 2 == 0) ans += A[j];
                else ans -= A[j];
                tmp /= 2;
            }
            if (ans == 7) {
                tmp = i + 1;
                System.out.print(A[0]);
                for (int j = 1; j < 4; j++) {
                    if (tmp % 2 == 0) 
                        System.out.print("+");
                    else System.out.print("-");
                    System.out.print(A[j]);
                    tmp /= 2;
                }
                System.out.println("=7");
                return;
            }
        }
    }
}

Compiler output:
Main.java:1: error: class T03 is public, should be declared in a file named T03.java
public class T03 {
       ^
1 error
Language: C++

#include <iostream>
#include <cmath>
#include <algorithm>


bool comp_fir(const std::pair<int, int> &x, const std::pair<int, int> &y){
	return x.first > y.first;
}

bool comp_sec(const std::pair<int, int> &x, const std::pair<int, int> &y){
	return x.second > y.second;
}


int main(){

	int tmp;
	std::cin >> tmp;

	std::vector<std::pair<int, int>> num;
	for(int i = 0; i < 4; i++){
		num.push_back(std::pair<int, int>(i, tmp / (int)(std::pow(10, i)) % 10));
	}

	// 降順にソート
	std::sort(num.begin(), num.end(), comp_sec);

	int sum = num[0].second;
	for(auto itr = (num.begin() + 1); itr != num.end(); itr++){

		if(sum + (*itr).second > 7){
			sum -= (*itr).second;
			(*itr).second *= (-1);
		}
		else{
			sum += (*itr).second;
		}

	}

	// 入力された順にソート
	std::sort(num.begin(), num.end(), comp_fir);

	std::cout << num[0].second;
	for(int i =1; i < 4; i++){
		std::cout << std::showpos << num[i].second;
	}
	std::cout << "=7" << std::endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: 'vector' is not a member of 'std'
   20 |         std::vector<std::pair<int, int>> num;
      |              ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <algorithm>
  +++ |+#include <vector>
    4 | 
a.cc:20:39: error: expected primary-expression before '>' token
   20 |         std::vector<std::pair<int, int>> num;
      |                                       ^~
a.cc:20:42: error: 'num' was not declared in this scope; did you mean 'enum'?
   20 |         std::vector<std::pair<int, int>> num;
      |                                          ^~~
      |                                          enum
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(void){
    int a,b[4];
    cin>>a;
    b[0] = (a % 10); a /= 10;　
    b[1] = (a % 10); a /= 10;　
    b[2] = (a % 10); a /= 10;　
    b[3] = (a % 10); a /= 10;　
                if( (b[0]+b[1]+b[2]+b[3])==7){
                    cout<<b[0]<<"+"<<b[1]<<"+"<<b[2]<<"+"<<b[3]<<"="<<7<<endl;
                }
                else if( (b[0]+b[1]+b[2]-b[3])==7){
                    cout<<b[0]<<"+"<<b[1]<<"+"<<b[2]<<"-"<<b[3]<<"="<<7<<endl;
                }
                else if((b[0]+b[1]-b[2]+b[3])==7){
                    cout<<b[0]<<"+"<<b[1]<<"-"<<b[2]<<"+"<<b[3]<<"="<<7<<endl;
                }
                else if((b[0]+b[1]-b[2]-b[3])==7){
                    cout<<b[0]<<"+"<<b[1]<<"-"<<b[2]<<"-"<<b[3]<<"="<<7<<endl;
                }
                else if((b[0]-b[1]+b[2]+b[3])==7){
                    cout<<b[0]<<"-"<<b[1]<<"+"<<b[2]<<"+"<<b[3]<<"="<<7<<endl;
                }
                else if((b[0]-b[1]+b[2]-b[3])==7){
                    cout<<b[0]<<"-"<<b[1]<<"+"<<b[2]<<"-"<<b[3]<<"="<<7<<endl;
                }
                else if((b[0]-b[1]-b[2]+b[3])==7){
                    cout<<b[0]<<"-"<<b[1]<<"-"<<b[2]<<"+"<<b[3]<<"="<<7<<endl;
                }
                else if((b[0]-b[1]-b[2]-b[3])==7){
                    cout<<b[0]<<"-"<<b[1]<<"-"<<b[2]<<"-"<<b[3]<<"="<<7<<endl;
                }
    
}


Compiler output:
a.cc:8:30: error: extended character 　 is not valid in an identifier
    8 |     b[0] = (a % 10); a /= 10;　
      |                              ^
a.cc:9:30: error: extended character 　 is not valid in an identifier
    9 |     b[1] = (a % 10); a /= 10;　
      |                              ^
a.cc:10:30: error: extended character 　 is not valid in an identifier
   10 |     b[2] = (a % 10); a /= 10;　
      |                              ^
a.cc:11:30: error: extended character 　 is not valid in an identifier
   11 |     b[3] = (a % 10); a /= 10;　
      |                              ^
a.cc: In function 'int main()':
a.cc:8:30: error: '\U00003000' was not declared in this scope
    8 |     b[0] = (a % 10); a /= 10;　
      |                              ^~
a.cc:9:32: error: expected ';' before 'b'
    9 |     b[1] = (a % 10); a /= 10;　
      |                                ^
      |                                ;
   10 |     b[2] = (a % 10); a /= 10;　
      |     ~                           
a.cc:10:32: error: expected ';' before 'b'
   10 |     b[2] = (a % 10); a /= 10;　
      |                                ^
      |                                ;
   11 |     b[3] = (a % 10); a /= 10;　
      |     ~                           
a.cc:11:32: error: expected ';' before 'if'
   11 |     b[3] = (a % 10); a /= 10;　
      |                                ^
      |                                ;
   12 |                 if( (b[0]+b[1]+b[2]+b[3])==7){
      |                 ~~              
a.cc:15:17: error: 'else' without a previous 'if'
   15 |                 else if( (b[0]+b[1]+b[2]-b[3])==7){
      |                 ^~~~
Language: C

#include <stdio.h>
int main(void){
    int a,b,c,d,e;
    scanf("%d",&a);
    b=a/1000;
    c=(a-b*1000)/100;
    d=(a-b*1000-c*100)/10;
    e=(a-b*1000-c*100-d*10);
    if(b+c+d+e==7){
        printf("%d+%d+%d+%d=7",b,c,d,e);
    }
    else if(b+c+d-e==7);{
        printf("%d+%d+%d-%d=7",b,c,d,e);
    }
    else if(b+c-d-e==7){
        printf("%d+%d-%d-%d=7",b,c,d,e);
    }
    else if(b+c-d+e==7){
        printf("%d+%d-%d+%d=7",b,c,d,e);
    }

    else if(b-c+d+e==7){
        printf("%d-%d+%d+%d=7",b,c,d,e);
    }
    else if(b-c+d-e==7){
        printf("%d-%d+%d-%d=7",b,c,d,e);
    }
    else if(b-c-d-e==7){
        printf("%d-%d-%d-%d=7",b,c,d,e);
    }
    else if(b-c-d+e==7){
        printf("%d-%d-%d+%d=7",b,c,d,e);
    }
    else{
        printf("Nooooooooooo");
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:5: error: 'else' without a previous 'if'
   15 |     else if(b+c-d-e==7){
      |     ^~~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(void){
    int a,b[4];
    cin>>a;
b[0] = (a % 10); a /= 10;　// 1桁目を取り出す
b[1] = (a % 10); a /= 10;　// 2桁目を取り出す
b[2] = (a % 10); a /= 10;　// 3桁目を取り出す
b[3] = (a % 10); a /= 10;　// 4桁目を取り出す
                if( (b[0]+b[1]+b[2]+b[3])==7){
                    cout<<b[0]<<"+"<<b[1]<<"+"<<b[2]<<"+"<<b[3]<<"="<<7<<endl;
                }
                else if( (b[0]+b[1]+b[2]-b[3])==7){
                    cout<<b[0]<<"+"<<b[1]<<"+"<<b[2]<<"-"<<b[3]<<"="<<7<<endl;
                }
                else if((b[0]+b[1]-b[2]+b[3])==7){
                    cout<<b[0]<<"+"<<b[1]<<"-"<<b[2]<<"+"<<b[3]<<"="<<7<<endl;
                }
                else if((b[0]+b[1]-b[2]-b[3])==7){
                    cout<<b[0]<<"+"<<b[1]<<"-"<<b[2]<<"-"<<b[3]<<"="<<7<<endl;
                }
                else if((b[0]-b[1]+b[2]+b[3])==7){
                    cout<<b[0]<<"-"<<b[1]<<"+"<<b[2]<<"+"<<b[3]<<"="<<7<<endl;
                }
                else if((b[0]-b[1]+b[2]-b[3])==7){
                    cout<<b[0]<<"-"<<b[1]<<"+"<<b[2]<<"-"<<b[3]<<"="<<7<<endl;
                }
                else if((b[0]-b[1]-b[2]+b[3])==7){
                    cout<<b[0]<<"-"<<b[1]<<"-"<<b[2]<<"+"<<b[3]<<"="<<7<<endl;
                }
                else if((b[0]-b[1]-b[2]-b[3])==7){
                    cout<<b[0]<<"-"<<b[1]<<"-"<<b[2]<<"-"<<b[3]<<"="<<7<<endl;
                }
    
}

Compiler output:
a.cc:8:26: error: extended character 　 is not valid in an identifier
    8 | b[0] = (a % 10); a /= 10;　// 1桁目を取り出す
      |                          ^
a.cc:9:26: error: extended character 　 is not valid in an identifier
    9 | b[1] = (a % 10); a /= 10;　// 2桁目を取り出す
      |                          ^
a.cc:10:26: error: extended character 　 is not valid in an identifier
   10 | b[2] = (a % 10); a /= 10;　// 3桁目を取り出す
      |                          ^
a.cc:11:26: error: extended character 　 is not valid in an identifier
   11 | b[3] = (a % 10); a /= 10;　// 4桁目を取り出す
      |                          ^
a.cc: In function 'int main()':
a.cc:8:26: error: '\U00003000' was not declared in this scope
    8 | b[0] = (a % 10); a /= 10;　// 1桁目を取り出す
      |                          ^~
a.cc:9:28: error: expected ';' before 'b'
    9 | b[1] = (a % 10); a /= 10;　// 2桁目を取り出す
      |                            ^
      |                            ;
   10 | b[2] = (a % 10); a /= 10;　// 3桁目を取り出す
      | ~                           
a.cc:10:28: error: expected ';' before 'b'
   10 | b[2] = (a % 10); a /= 10;　// 3桁目を取り出す
      |                            ^
      |                            ;
   11 | b[3] = (a % 10); a /= 10;　// 4桁目を取り出す
      | ~                           
a.cc:11:28: error: expected ';' before 'if'
   11 | b[3] = (a % 10); a /= 10;　// 4桁目を取り出す
      |                            ^
      |                            ;
   12 |                 if( (b[0]+b[1]+b[2]+b[3])==7){
      |                 ~~          
a.cc:15:17: error: 'else' without a previous 'if'
   15 |                 else if( (b[0]+b[1]+b[2]-b[3])==7){
      |                 ^~~~
Language: C

#include <stdio.h>

int main(void) {
int A, B, C, D;
int ans;
int i,j,k;

scanf("%d", &D);
A = D / 1000;
B = (D - A * 1000) / 100;
C = (D - A * 1000 - B * 100) / 10;
D = D - A * 1000 - B * 100 - C * 10;

ans = 0;
for(i = 0; i < 2; i++) {
  for(j = 0; j < 2; j++) {
    for(k = 0; k < 2; k++) {
      if(i == 0) {
        ans += A;
        ans += B;
      }
      else {
        ans += A;
        ans -= B;
      }
      if(j == 0) {
        ans += C;
      }
      else {
       

Compiler output:
main.c: In function 'main':
main.c:29:7: error: expected declaration or statement at end of input
   29 |       else {
      |       ^~~~
main.c:29:7: error: expected declaration or statement at end of input
main.c:29:7: error: expected declaration or statement at end of input
main.c:29:7: error: expected declaration or statement at end of input
main.c:29:7: error: expected declaration or statement at end of input
Language: C++

#include <iostream>
using namespace std;

void main (){
	int a;
	cin >> a;
	int ch[4];
	for(int i = 0;i < 4;i++){
		ch[i] = a % 10;
		a /= 10;
	}
	if((ch[3] + ch[2] + ch[1] + ch[0]) == 7){
		cout << ch[3] << '+' << ch[2] << '+' << ch[1] << '+' << ch[0] << "=7";
	}else if((ch[3] - ch[2] + ch[1] + ch[0]) == 7){
		cout << ch[3] << '-' << ch[2] << '+' << ch[1] << '+' << ch[0] << "=7";
	}else if((ch[3] + ch[2] - ch[1] + ch[0]) == 7){
		cout << ch[3] << '+' << ch[2] << '-' << ch[1] << '+' << ch[0] << "=7";
	}else if((ch[3] + ch[2] + ch[1] - ch[0]) == 7){
		cout << ch[3] << '+' << ch[2] << '+' << ch[1] << '-' << ch[0] << "=7";
	}else if((ch[3] + ch[2] - ch[1] - ch[0]) == 7){
		cout << ch[3] << '+' << ch[2] << '-' << ch[1] << '-' << ch[0] << "=7";
	}else if((ch[3] - ch[2] + ch[1] - ch[0]) == 7){
		cout << ch[3] << '-' << ch[2] << '+' << ch[1] << '-' << ch[0] << "=7";
	}else if((ch[3] - ch[2] - ch[1] + ch[0]) == 7){
		cout << ch[3] << '-' << ch[2] << '-' << ch[1] << '+' << ch[0] << "=7";
	}else if((ch[3] - ch[2] - ch[1] - ch[0]) == 7){
		cout << ch[3] << '-' << ch[2] << '-' << ch[1] << '-' << ch[0] << "=7";
	}
}

Compiler output:
a.cc:4:1: error: '::main' must return 'int'
    4 | void main (){
      | ^~~~
Language: C++

#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "iomanip"
#include "cmath"

using namespace std;

const long long int MOD = 1000000007;

long long int N, M, K, H, W, L, R;

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

	string t = { "+-" };
	string s;
	cin >> s;
	for (int i = 0; i < 2; i++) {
		for (int j = 0; j < 2; j++) {
			for (int k = 0; k < 2; k++) {
				if (s[0] - '0' + (i * 2 - 1)*(s[1] - '0') + (j * 2 - 1)*(s[e] - '0') + (k * 2 - 1)*(s[3] - '0') == 7) {
					cout << s[0] << t[i] << s[1] << t[j] << s[2] << t[k] << s[3] << endl;
					return 0;
				}
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:92: error: 'e' was not declared in this scope
   30 |                                 if (s[0] - '0' + (i * 2 - 1)*(s[1] - '0') + (j * 2 - 1)*(s[e] - '0') + (k * 2 - 1)*(s[3] - '0') == 7) {
      |                                                                                            ^
Language: C++

#include<iostream>
#include<sstream>
using namespace std;
int a,b,c,d;
char e, f, g, h;
string ans;
void sum(int x, char y, int z) {





}
int main() {
	stringstream ss1, ss2, ss3, ss4;
	ss1 << a;
	ss1 >> e;
	ss1 << b;
	ss1 >> f;
	ss1 << g;
	ss1 >> e;
	ss1 << d;
	ss1 >> h;
	cin >> a>>b>>c>>d;
	if (a + b + c + d == 7) {
		ans = e + "+" + f;
		ans += "+" + g;
		ans += "+" + h;
		ans += "=7";
	if (a - b + c + d == 7) {
		ans = e + "-" + f;
		ans += "+" + g;
		ans += "+" + h;
		ans += "=7";
	}
	if (a + b - c + d == 7) {
		ans = e + "+" + f;
		ans += "-" + g;
		ans += "+" + h;
		ans += "=7";
	}
	if (a + b + c - d == 7) {
		ans = e + "+" + f;
		ans += "+" + g;
		ans += "-" + h;
		ans += "=7";
	}
	if (a - b - c + d == 7) {
		ans = e + "-" + f;
		ans += "-" + g;
		ans += "+" + h;
		ans += "=7";
	}
	if (a + b - c - d == 7) {
		ans = e + "+" + f;
		ans += "-" + g;
		ans += "-" + h;
		ans += "=7";
	}
	if (a - b + c - d == 7) {
		ans = e + "^" + f;
		ans += "+" + g;
		ans += "-" + h;
		ans += "=7";
	}
	if (a - b - c - d == 7) {
		ans = e + "-" + f;
		ans += "-" + g;
		ans += "-" + h;
		ans += "=7";
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:74:2: error: expected '}' at end of input
   74 | }
      |  ^
a.cc:14:12: note: to match this '{'
   14 | int main() {
      |            ^
Language: C++

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

#define rep(i,a,b)                for(ll i=a;i<b;i++)
#define re(i,b)                for(ll i=0;i<b;i++)
#define repr(i,n)                for(ll i=n-1;i>=0;i--)
#define ll long long
#define ld long double
#define pll std::pair<ll, ll> 
#define ppll std::pair<ll, pll>
#define vll std::vector<ll> 
#define vpll std::vector<pll> 
#define vppll std::vector<ppll> 
#define mll std::unordered_map<ll, ll> 
#define mpll std::unordered_map<pll, ll>
#define mppll std::unordered_map<ppll, ll>
#define sll std::set<ll>
#define ff first
#define ss second
#define msll std::multiset<ll>
#define all(c) c.begin(), c.end()
#define allr(c) c.rbegin(), c.rend()
#define srt(x) sort(all(x))
#define rsrt(x) sort(allr(x))
#define eb emplace_back
#define pb push_back
#define s(yy) ll yy;cin>>yy
#define len length()
#define sz size()
const ll mod = 1e9 + 7;
const ll INF = 0x7FFFFFFFFFFFFFFF>>1;

/*#################################################### 
#                                                    #
#                     @author                        #
#                  Parth Lathiya                     #
#      https://www.cse.iitb.ac.in/~parthiitb/        #
#                                                    #
####################################################*/

fun(ll a,ll b,ll c)
{
	if(c&1)
		return a-b;
	return a+b;
}

int main()
{

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	#ifdef PARTH_LATHIYA_HOME

		freopen("C_in.txt","r",stdin);
	
		ll ttt,bkkk;
		cin>>ttt;
		bkkk=ttt;
		while(ttt--) {
			cout<<"Testcase - "<<bkkk-ttt<<"\n";
	#endif

//--------------------------------------------------------------------------------------
	s(n);
	int a, b,c,d;
	d=n%10;
	c=(n/10)%10;
	b=(n/100)%10;
	a=(n/1000)%10;
	
	re(i,2)
		re(j,2)
			re(k,2)
				if(fun(fun(fun(a,b,i),c,j),d,k)==7){
					char aa=(i==0)?'+':'-';
					char bb=(j==0)?'+':'-';
					char cc=(k==0)?'+':'-';
					cout<<a<<aa<<b<<bb<<c<<cc<<d<<"=7";
					return 0;
				}

//--------------------------------------------------------------------------------------
	
	#ifdef PARTH_LATHIYA_HOME
		cout<<"\n"; }
	#endif

	return 0;
}

Compiler output:
a.cc:41:1: error: ISO C++ forbids declaration of 'fun' with no type [-fpermissive]
   41 | fun(ll a,ll b,ll c)
      | ^~~