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

#include<stdio.h>
int main(void)
{
	int S = 0;
	int a, b, c, d;
	int e = +;

	scanf("%d%d%d%d", &a, &b, &c, &d);

	if (a = e) {
		S++;
	}
	else {
		S--;
	}
	if (b = e) {
		S++;
	}
	else {
		S--;
	}

	if (c = e) {
		S++;
	}
	else {
		S--;
	}

	if (d = e) {
		S++;
	}
	else {
		S--;
	}
	printf("%d", S);
	return 0;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: expected primary-expression before ';' token
    6 |         int e = +;
      |                  ^
Language: C++

#include<iostream>
using namespace std;
int main(){
	string s;
	int n=0;
	cin>>S;
	for(int i=0;i<s.size();i++)
		if(s[i]=='-')n--;
		else n++;
	cout<<n;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: 'S' was not declared in this scope
    6 |         cin>>S;
      |              ^
Language: C++

#include <iostream>

int main(){
    std::string i1, i2, i3, i4;
    std::cin >> i1 >> i2 >> i3 >> i4;
    std::vector<std::string> str = { i1, i2, i3, i4};
    int result = 0;
    for (std::size_t i = 0; i < str.size(); ++i) {
       if (str[i] == +) {
           result++;
       } else if (str[i] == -) {
           result—;
       } else {
           continue;
       }
    }
    std::cout << result << std::endl;
    return 0;
}


Compiler output:
a.cc:12:12: error: extended character — is not valid in an identifier
   12 |            result—;
      |            ^
a.cc: In function 'int main()':
a.cc:6:10: error: 'vector' is not a member of 'std'
    6 |     std::vector<std::string> str = { i1, i2, i3, i4};
      |          ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | 
a.cc:6:28: error: expected primary-expression before '>' token
    6 |     std::vector<std::string> str = { i1, i2, i3, i4};
      |                            ^
a.cc:6:30: error: 'str' was not declared in this scope; did you mean 'std'?
    6 |     std::vector<std::string> str = { i1, i2, i3, i4};
      |                              ^~~
      |                              std
a.cc:9:23: error: expected primary-expression before ')' token
    9 |        if (str[i] == +) {
      |                       ^
a.cc:11:30: error: expected primary-expression before ')' token
   11 |        } else if (str[i] == -) {
      |                              ^
a.cc:12:12: error: 'result\U00002014' was not declared in this scope; did you mean 'result'?
   12 |            result—;
      |            ^~~~~~~
      |            result
Language: C

#include <stdio.h>

int main()
{
	int x = 1;
	char takahashi[5];
	printf("入力：");

	
	scanf_s("%s", takahashi, 5);
	
	for(int i = 0; i < 4; i++)
	{
		if (takahashi[i] == '+')
		{
			x++;
		}
		else if (takahashi[i] == '-')
		{
			x--;
		}	
	}
	return x;
}

Compiler output:
main.c: In function 'main':
main.c:10:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   10 |         scanf_s("%s", takahashi, 5);
      |         ^~~~~~~
      |         scanf
Language: C++

#include<iostream>
using namespace stdl;
int main(){
	string s;
	int n=0;
	cin>>S;
	for(int i=0;i<s.size();i++)
		if(s[i]=='-')n--;
		else n++;
	cout<<n;
}

Compiler output:
a.cc:2:17: error: 'stdl' is not a namespace-name
    2 | using namespace stdl;
      |                 ^~~~
a.cc: In function 'int main()':
a.cc:4:9: error: 'string' was not declared in this scope
    4 |         string s;
      |         ^~~~~~
a.cc:4:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         cin>>S;
      |         ^~~
      |         std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:14: error: 'S' was not declared in this scope
    6 |         cin>>S;
      |              ^
a.cc:7:23: error: 's' was not declared in this scope
    7 |         for(int i=0;i<s.size();i++)
      |                       ^
a.cc:10:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |         cout<<n;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <stdio.h>

int main()
{
	int x = 1;
	char takahashi[5];
	printf("入力：");

	
	scanf_s("%s", takahashi, 5);
	
	for(int i = 0; i < 4; i++)
	{
		if (takahashi[i] == '+')
		{
			x++;
		}
		else if (takahashi[i] == '-')
		{
			x--;
		}	
	}
	return x;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   10 |         scanf_s("%s", takahashi, 5);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <iostream>

int main(){
    std::string i1, i2, i3, i4;
    std::cin >> i1 >> i2 >> i3 >> i4;
    std::vector<string> str = { i1, i2, i3, i4};
    int result = 0;
    for (std::size_t i = 0; i < str.size(); ++i) {
       if (str[i] == +) {
           result++;
       } else if (str[i] == -) {
           result—;
       } else {
           continue;
       }
    }
    std::cout << result << std::endl;
    return 0;
}


Compiler output:
a.cc:12:12: error: extended character — is not valid in an identifier
   12 |            result—;
      |            ^
a.cc: In function 'int main()':
a.cc:6:10: error: 'vector' is not a member of 'std'
    6 |     std::vector<string> str = { i1, i2, i3, i4};
      |          ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | 
a.cc:6:17: error: 'string' was not declared in this scope
    6 |     std::vector<string> str = { i1, i2, i3, i4};
      |                 ^~~~~~
a.cc:6:17: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:6:25: error: 'str' was not declared in this scope; did you mean 'std'?
    6 |     std::vector<string> str = { i1, i2, i3, i4};
      |                         ^~~
      |                         std
a.cc:9:23: error: expected primary-expression before ')' token
    9 |        if (str[i] == +) {
      |                       ^
a.cc:11:30: error: expected primary-expression before ')' token
   11 |        } else if (str[i] == -) {
      |                              ^
a.cc:12:12: error: 'result\U00002014' was not declared in this scope; did you mean 'result'?
   12 |            result—;
      |            ^~~~~~~
      |            result
Language: C++

#include<stdio.h>
int main(void)
{
	int S = 0;
	int a, b, c, d;
	int e = +;

	scanf("%d%d%d%d", &a, &b, &c, &d);

	if (a = e) {
		S++;
	}
	else {
		S--;
	}
	if (b = e) {
		S++;
	}
	else {
		S--;
	}

	if (c = e) {
		S++;
	}
	else {
		S--;
	}

	if (d = e) {
		S++;
	}
	else {
		S--;
	}
	printf("%d", &S);
	return 0;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: expected primary-expression before ';' token
    6 |         int e = +;
      |                  ^
Language: C++

#include <stdio.h>

int main()
{
	int x = 1;
	char takahashi[5];
	printf("入力：");

	
	scanf_s("%s", takahashi, 5);
	
	
	printf("%s\n", takahashi);

	for(int i = 0; i < 4; i++)
	{
		if (takahashi[i] == '+')
		{
			x++;
			printf("+\n");
		}
		else if (takahashi[i] == '-')
		{
			x--;
			printf("-\n");
		}	
	}
	return x;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   10 |         scanf_s("%s", takahashi, 5);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <iostream>

int main(){
    std::cin >> i1 >> i2 >> i3 >> i4;
    std::vector<string> str = { i1, i2, i3, i4};
    int result = 0;
    for (std::size_t i = 0; i < str.size(); ++i) {
       if (str[i] == +) {
           result++;
       } else if (str[i] == -) {
           result—;
       } else {
           continue;
       }
    }
    std::cout << result << std::endl;
    return 0;
}


Compiler output:
a.cc:11:12: error: extended character — is not valid in an identifier
   11 |            result—;
      |            ^
a.cc: In function 'int main()':
a.cc:4:17: error: 'i1' was not declared in this scope
    4 |     std::cin >> i1 >> i2 >> i3 >> i4;
      |                 ^~
a.cc:4:23: error: 'i2' was not declared in this scope
    4 |     std::cin >> i1 >> i2 >> i3 >> i4;
      |                       ^~
a.cc:4:29: error: 'i3' was not declared in this scope
    4 |     std::cin >> i1 >> i2 >> i3 >> i4;
      |                             ^~
a.cc:4:35: error: 'i4' was not declared in this scope
    4 |     std::cin >> i1 >> i2 >> i3 >> i4;
      |                                   ^~
a.cc:5:10: error: 'vector' is not a member of 'std'
    5 |     std::vector<string> str = { i1, i2, i3, i4};
      |          ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | 
a.cc:5:17: error: 'string' was not declared in this scope
    5 |     std::vector<string> str = { i1, i2, i3, i4};
      |                 ^~~~~~
a.cc:5:17: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:5:25: error: 'str' was not declared in this scope; did you mean 'std'?
    5 |     std::vector<string> str = { i1, i2, i3, i4};
      |                         ^~~
      |                         std
a.cc:8:23: error: expected primary-expression before ')' token
    8 |        if (str[i] == +) {
      |                       ^
a.cc:10:30: error: expected primary-expression before ')' token
   10 |        } else if (str[i] == -) {
      |                              ^
a.cc:11:12: error: 'result\U00002014' was not declared in this scope; did you mean 'result'?
   11 |            result—;
      |            ^~~~~~~
      |            result
Language: C

#include <stdio.h>
int main(int argc,char *argv[]){
  int sum = 0;
  for(i=0;i < argc ; i++){
    if(argv[i] == "+"){
      sum++;
    }else if(argv[i] == "-"){
      sum--;
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:7: error: 'i' undeclared (first use in this function)
    4 |   for(i=0;i < argc ; i++){
      |       ^
main.c:4:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
#include <string.h>
#include <stdio.h>
using namespace std;

int main() {
  int a=0;
  char b[4];
  cin >> b;
  if (!strcmp(b[0], "+")) a+=1;
  else a-=1;
  if (!strcmp(b[1], "+")) a+=1;
  else a-=1;
  if (!strcmp(b[2], "+")) a+=1;
  else a-=1;
  if (!strcmp(b[3], "+")) a+=1;
  else a-=1;
  cout << a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   10 |   if (!strcmp(b[0], "+")) a+=1;
      |               ~~~^
      |                  |
      |                  char
In file included from a.cc:2:
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:12:18: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   12 |   if (!strcmp(b[1], "+")) a+=1;
      |               ~~~^
      |                  |
      |                  char
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:14:18: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   14 |   if (!strcmp(b[2], "+")) a+=1;
      |               ~~~^
      |                  |
      |                  char
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:16:18: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   16 |   if (!strcmp(b[3], "+")) a+=1;
      |               ~~~^
      |                  |
      |                  char
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
Language: C++

#include <iostream>

int main(){
    std::cin >> i1 >> i2 >> i3 >> i4;
    std::vector<string> str = { i1, i2, i3, i4};
    int result = 0;
    for (std::size_t i = 0; i < str.size(); ++i) {
       if (str[i] = +) {
           result++;
       } else (str[i] = -) {
           result—;
       }
    }
    std::cout << result << std::endl;
    return 0;
}


Compiler output:
a.cc:11:12: error: extended character — is not valid in an identifier
   11 |            result—;
      |            ^
a.cc: In function 'int main()':
a.cc:4:17: error: 'i1' was not declared in this scope
    4 |     std::cin >> i1 >> i2 >> i3 >> i4;
      |                 ^~
a.cc:4:23: error: 'i2' was not declared in this scope
    4 |     std::cin >> i1 >> i2 >> i3 >> i4;
      |                       ^~
a.cc:4:29: error: 'i3' was not declared in this scope
    4 |     std::cin >> i1 >> i2 >> i3 >> i4;
      |                             ^~
a.cc:4:35: error: 'i4' was not declared in this scope
    4 |     std::cin >> i1 >> i2 >> i3 >> i4;
      |                                   ^~
a.cc:5:10: error: 'vector' is not a member of 'std'
    5 |     std::vector<string> str = { i1, i2, i3, i4};
      |          ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | 
a.cc:5:17: error: 'string' was not declared in this scope
    5 |     std::vector<string> str = { i1, i2, i3, i4};
      |                 ^~~~~~
a.cc:5:17: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:5:25: error: 'str' was not declared in this scope; did you mean 'std'?
    5 |     std::vector<string> str = { i1, i2, i3, i4};
      |                         ^~~
      |                         std
a.cc:8:22: error: expected primary-expression before ')' token
    8 |        if (str[i] = +) {
      |                      ^
a.cc:10:26: error: expected primary-expression before ')' token
   10 |        } else (str[i] = -) {
      |                          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int n=0;
stirng a;
cin >> a;
for(int i = 0;i < 4 ;i++){
   if(a.at(i) == '+')
       n++;
   else
       n--;
}
cout << n << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:1: error: 'stirng' was not declared in this scope
    5 | stirng a;
      | ^~~~~~
a.cc:6:8: error: 'a' was not declared in this scope
    6 | cin >> a;
      |        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
char s[500000];
int i,j,k,n,m,x,y,t;
int main(){
	gets(s+1);
	n=strlen(s+1);
	for (i=1;i<=n;i++)x=x+(s[i]=='+'?1:-1);
	printf("%d\n",x);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    6 |         gets(s+1);
      |         ^~~~
      |         getw
Language: Java

import java.util.Scanner;

public class EatingSymbols {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String s = scanner.nextLine();
		System.out.print(Solution(s));
	}
	static int Solution(String s) {
		int sum = 0;
		
		for(int i=0; i<s.length(); i++) {
			if(s.charAt(i)== '+') {
				sum = sum + 1;
			}else {
				sum = sum - 1;
			}
		}
		return sum;
	}
}

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

#include <stdio.h>

int main(void)
{
	int a, A, B, C, D;
	scanf("&s&s&s&s", ABCD);

	printf("%d", a);

	if (A=+)
		puts("%d", a + 1);
	else
	printf("%d", a - 1);

	if (B=+)
		printf("%d", a + 1);
	else
	prinf("%d", a - 1);

	if (C=+)
		printf("%d", a + 1);
	else
	printf("%d", a - 1);

	if (D=+)
		printf("%d", a + 1);
	else
	printf("%d", a - 1);

	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:27: error: 'ABCD' undeclared (first use in this function)
    6 |         scanf("&s&s&s&s", ABCD);
      |                           ^~~~
main.c:6:27: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:16: error: expected expression before ')' token
   10 |         if (A=+)
      |                ^
main.c:11:17: error: too many arguments to function 'puts'
   11 |                 puts("%d", a + 1);
      |                 ^~~~
In file included from main.c:1:
/usr/include/stdio.h:714:12: note: declared here
  714 | extern int puts (const char *__s);
      |            ^~~~
main.c:15:16: error: expected expression before ')' token
   15 |         if (B=+)
      |                ^
main.c:18:9: error: implicit declaration of function 'prinf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   18 |         prinf("%d", a - 1);
      |         ^~~~~
      |         printf
main.c:20:16: error: expected expression before ')' token
   20 |         if (C=+)
      |                ^
main.c:25:16: error: expected expression before ')' token
   25 |         if (D=+)
      |                ^
Language: C++

#include<iostream>
#include <string.h>
using namespace std;

int main() {
  int a=0;
  char b[4];
  cin >> b;
  if (!strcmp(b[0], "+")) a+=1;
  else a-=1;
  if (!strcmp(b[1], "+")) a+=1;
  else a-=1;
  if (!strcmp(b[2], "+")) a+=1;
  else a-=1;
  if (!strcmp(b[3], "+")) a+=1;
  else a-=1;
  cout << a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
    9 |   if (!strcmp(b[0], "+")) a+=1;
      |               ~~~^
      |                  |
      |                  char
In file included from a.cc:2:
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:11:18: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   11 |   if (!strcmp(b[1], "+")) a+=1;
      |               ~~~^
      |                  |
      |                  char
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:13:18: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   13 |   if (!strcmp(b[2], "+")) a+=1;
      |               ~~~^
      |                  |
      |                  char
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:15:18: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   15 |   if (!strcmp(b[3], "+")) a+=1;
      |               ~~~^
      |                  |
      |                  char
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
      int n=0,i=0,a[1024];
      scanf("%s",&a);
      while(a[i]=='+'||a[i]=='-'）
      {
             if(a[i]=='+')
             {
                   n+=1;
             }
             else
             {
                   n-=1;
             }
         }
         printf("%d",n);
         return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:30: error: unable to find character literal operator 'operator""\U0000ff09' with 'char' argument
    7 |       while(a[i]=='+'||a[i]=='-'）
      |                              ^~~~~
a.cc:7:35: error: expected ')' before '{' token
    7 |       while(a[i]=='+'||a[i]=='-'）
      |            ~                      ^
      |                                   )
    8 |       {
      |       ~
Language: C++

#include <iostream>
using namespace std;
int main{
  string S;
  cin>>S;
  int a=0;
  for(int i=0;i<4;i++){
    if(S[i]=='+')a++;
    if(S[i]=='-')a--;
    cout<<a<<endl;
  }
  return 0;
}

Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main{
      |     ^~~~
a.cc:4:10: error: expected primary-expression before 'S'
    4 |   string S;
      |          ^
a.cc:4:10: error: expected '}' before 'S'
a.cc:3:9: note: to match this '{'
    3 | int main{
      |         ^
a.cc:5:3: error: 'cin' does not name a type
    5 |   cin>>S;
      |   ^~~
a.cc:7:3: error: expected unqualified-id before 'for'
    7 |   for(int i=0;i<4;i++){
      |   ^~~
a.cc:7:15: error: 'i' does not name a type
    7 |   for(int i=0;i<4;i++){
      |               ^
a.cc:7:19: error: 'i' does not name a type
    7 |   for(int i=0;i<4;i++){
      |                   ^
a.cc:12:3: error: expected unqualified-id before 'return'
   12 |   return 0;
      |   ^~~~~~
a.cc:13:1: error: expected declaration before '}' token
   13 | }
      | ^
Language: C++

#include<stdio.h>
int main(void)
{
	int S = 0;
	char a, b, c, d;
    char e = +;

	scanf("%d%d%d%d", a, b, c, d);

	if (a = e) {
		S++;
	}
	else {
		S--;
	}
	if (b = e) {
		S++;
	}
	else {
		S--;
	}

	if (c = e) {
		S++;
	}
	else {
		S--;
	}

	if (d = e) {
		S++;
	}
	else {
		S--;
	}
	printf("%d", &S);
	return 0;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: error: expected primary-expression before ';' token
    6 |     char e = +;
      |               ^
Language: Java


import java.util.Scanner;

public class test {

	public static void main(String[] args) {
		String S = new java.util.Scanner (System.in).nextLine();	
		String[] ar = S.split("");
		int t = 0;
		for (int i= 0; i<4;i++) {
			if(ar[i] == "+" ) t++;
			else t--;
		}
		
		System.out.println(t);
		}

}


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

#include<iostream>
using namespace std;

int main() {
  int a=0;
  char b[4];
  cin >> b;
  if (!strcmp(b[0], "+")) a+=1;
  else a-=1;
  if (!strcmp(b[1], "+") a+=1;
  else a-=1;
  if (!strcmp(b[2], "+") a+=1;
  else a-=1;
  if (!strcmp(b[3], "+") a+=1;
  else a-=1;
  cout << a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'strcmp' was not declared in this scope
    8 |   if (!strcmp(b[0], "+")) a+=1;
      |        ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
a.cc:10:8: error: 'strcmp' was not declared in this scope
   10 |   if (!strcmp(b[1], "+") a+=1;
      |        ^~~~~~
a.cc:10:8: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:11:3: error: expected primary-expression before 'else'
   11 |   else a-=1;
      |   ^~~~
a.cc:10:31: error: expected ')' before 'else'
   10 |   if (!strcmp(b[1], "+") a+=1;
      |      ~                        ^
      |                               )
   11 |   else a-=1;
      |   ~~~~                         
a.cc:12:8: error: 'strcmp' was not declared in this scope
   12 |   if (!strcmp(b[2], "+") a+=1;
      |        ^~~~~~
a.cc:12:8: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:13:3: error: expected primary-expression before 'else'
   13 |   else a-=1;
      |   ^~~~
a.cc:12:31: error: expected ')' before 'else'
   12 |   if (!strcmp(b[2], "+") a+=1;
      |      ~                        ^
      |                               )
   13 |   else a-=1;
      |   ~~~~                         
a.cc:14:8: error: 'strcmp' was not declared in this scope
   14 |   if (!strcmp(b[3], "+") a+=1;
      |        ^~~~~~
a.cc:14:8: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:15:3: error: expected primary-expression before 'else'
   15 |   else a-=1;
      |   ^~~~
a.cc:14:31: error: expected ')' before 'else'
   14 |   if (!strcmp(b[3], "+") a+=1;
      |      ~                        ^
      |                               )
   15 |   else a-=1;
      |   ~~~~
Language: C++

#include <iostream>
using namespace std;
int main(void){
    string s;
    cin >> s;
    int ans=0;
    for(int i=0,b=1;i<4;i++,b++){
        if(s[b]=='+'){
            ans++;
        }else{
            ans--;
        }
    }cout << ans << endl;
}
    }cout << ans << endl;
}

Compiler output:
a.cc:15:5: error: expected declaration before '}' token
   15 |     }cout << ans << endl;
      |     ^
a.cc:15:6: error: 'cout' does not name a type
   15 |     }cout << ans << endl;
      |      ^~~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: Java

public static void main(String[] args) {
		String S = new java.util.Scanner (System.in).nextLine();	
		String[] ar = S.split("");
		int t = 0;
		for (int i= 0; i<4;i++) {
			if(ar[i] == "+" ) t++;
			else t--;
		}
		
		System.out.println(t);
		}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: C

#include<stdio.h>
int main(){
    char *s;
    int i,ans=0;
    scanf("%s",s);
    for(i=0; i<4; i++){
        if(s[i]=='+'){
            ans++;
        }
        else{
            ans--:
        }
    }
    printf("%d\n",ans);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:18: error: expected ';' before ':' token
   11 |             ans--:
      |                  ^
      |                  ;
Language: C

#include <stdio.h>

int main()
{
	int A,B,C,D;
	scanf("&s&s&s&s,ABCD");

	printf("%d,a+1")
	if (A=+)
		puts("%d,a+1");
	else; 
	printf("%d,a-1");
	
	if (B= +)
		printf("%d,a+1");
	else;
	prinf("%d,a-1");
			
	if (C = +)
		printf("%d,a+1");
	else;
		printf("%d,a-1");
				
	if (D = +)
		printf("%d,a+1");
	else;
		printf("%d,a-1");
	
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:25: error: expected ';' before 'if'
    8 |         printf("%d,a+1")
      |                         ^
      |                         ;
    9 |         if (A=+)
      |         ~~               
main.c:11:9: error: 'else' without a previous 'if'
   11 |         else;
      |         ^~~~
main.c:14:17: error: expected expression before ')' token
   14 |         if (B= +)
      |                 ^
main.c:17:9: error: implicit declaration of function 'prinf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   17 |         prinf("%d,a-1");
      |         ^~~~~
      |         printf
main.c:19:18: error: expected expression before ')' token
   19 |         if (C = +)
      |                  ^
main.c:24:18: error: expected expression before ')' token
   24 |         if (D = +)
      |                  ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
  char s[4];
  for(int i=0;i<4;i++)
    cin>>s[i];
  int val=0;
  for(int i=0;i<4;i++)
  {
    if(s[i]=='+')
      val++;
    else
      val--;
  }
  cout<<val<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:16:19: error: expected '}' at end of input
   16 |   cout<<val<<endl;
      |                   ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

#include<stdio.h>
char s[10000];
int main()
{
	gets(s);
	int i, w = 0;
	for (i = 0; s[i] != '\0'; i++)
	{
		if (s[i] == '-')
			w--;
		if (s[i] == '+')
			w++;
	}
	printf("%d", w);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    5 |         gets(s);
      |         ^~~~
      |         getw
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	string st;
	cin>>st;
	int s=0;
	for(int i=0;i<st.length();i++){
		if(st[i]=='+') s+=1;
		else s-=1; 
	}
	cout<<s<<endl;
	return 0;
}

、

Compiler output:
a.cc:15:1: error: extended character 、 is not valid in an identifier
   15 | 、
      | ^
a.cc:15:1: error: '\U00003001' does not name a type
   15 | 、
      | ^~
Language: C++

#include<stdio.h>
char s[10000];
int main()
{
	gets(s);
	int i, w = 0;
	for (i = 0; s[i] != '\0'; i++)
	{
		if (s[i] == '-')
			w--;
		if (s[i] == '+')
			w++;
	}
	printf("%d", w);
	system("pause");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    5 |         gets(s);
      |         ^~~~
      |         getw
a.cc:15:9: error: 'system' was not declared in this scope
   15 |         system("pause");
      |         ^~~~~~
Language: C++

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

int main() {
  string S;
  int ans = 0;
  cin >> S;
  for (int i = 0; i < 4; i++) {
    if (S.at(i) == "+") {
      ans++;
    } else {
      ans--;
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     if (S.at(i) == "+") {
      |         ~~~~~~~~^~~~~~
Language: Java

public class Main
{
	public static void main(String[] args)
	{
		int n = 0;
		Scanner s = new Scanner(System.in);
		String l = s.nextLine();
		
		for (int i = 0; i < 4; i++)
		{
			n = l.charAt(i) == '+' ? n + 1 : n - 1;
		}
		s.close();
		System.out.println(n);
	}
}

Compiler output:
Main.java:6: error: cannot find symbol
		Scanner s = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:6: error: cannot find symbol
		Scanner s = new Scanner(System.in);
		                ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include<iostream>
using namespace std;

int main() {
  int a=0;
  char b[4];
  cin >> b;
  if (b[1]=="+") a+=1;
  else a-=1;
  if (b[2]=="+") a+=1;
  else a-=1;
  if (b[3]=="+") a+=1;
  else a-=1;
  if (b[4]=="+") a+=1;
  else a-=1;
  cout << a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |   if (b[1]=="+") a+=1;
      |       ~~~~^~~~~
a.cc:10:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |   if (b[2]=="+") a+=1;
      |       ~~~~^~~~~
a.cc:12:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   if (b[3]=="+") a+=1;
      |       ~~~~^~~~~
a.cc:14:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |   if (b[4]=="+") a+=1;
      |       ~~~~^~~~~
Language: C

#include<stdio.h>
int main()
{
  char a[5];
  scanf("%s"&a);
  int ans=0;
  for(int i=0;i<4;i++)
  {
    if(a[i]=='+')
      ans++;
    else 
      ans--;
  }
  printf("%d",ans);
}

Compiler output:
main.c: In function 'main':
main.c:5:13: error: invalid operands to binary & (have 'char *' and 'char *')
    5 |   scanf("%s"&a);
      |         ~~~~^
      |         |   |
      |         |   char *
      |         char *
Language: C++

#inclide<iostream>
using namespace std;

int main() {
  int a=0;
  char b[4];
  cin >> b;
  if (b[1]=="+") a+=1;
  else a-=1;
  if (b[2]=="+") a+=1;
  else a-=1;
  if (b[3]=="+") a+=1;
  else a-=1;
  if (b[4]=="+") a+=1;
  else a-=1;
  cout << a;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inclide; did you mean #include?
    1 | #inclide<iostream>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin >> b;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inclide<iostream>
a.cc:8:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |   if (b[1]=="+") a+=1;
      |       ~~~~^~~~~
a.cc:10:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |   if (b[2]=="+") a+=1;
      |       ~~~~^~~~~
a.cc:12:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   if (b[3]=="+") a+=1;
      |       ~~~~^~~~~
a.cc:14:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |   if (b[4]=="+") a+=1;
      |       ~~~~^~~~~
a.cc:16:3: error: 'cout' was not declared in this scope
   16 |   cout << a;
      |   ^~~~
a.cc:16:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: Java

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String str = in.next();
		int num = 0;
		for(int i=0;i<4;i++) {
			char nowChar = str.charAt(i);
			if(nowChar=='+') {
				num++;
			}else if(nowChar=='-') {
				num--;
			}
		}
		System.out.println(num);
	}
}

Compiler output:
Main.java:4: error: cannot find symbol
		Scanner in = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner in = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

public class Main {
  	public static void main(String[] args) {
	// TODO Auto-generated method stub
	int x = 0;
	for (int i = 0; i<4; i++){
		if ( args[0].charAt(i) == '+' ) x++;
	}
		
	System.out.println((x - 2)*2);
	
}

Compiler output:
Main.java:11: error: reached end of file while parsing
}
 ^
1 error
Language: Java

import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int res = 0;
        String s = sc.nextLine();

        for(int i=0; i<4; i++) {
            char c = s.(i);
            if(c=='+') res++;
            else if(c=='-') res--;
        }
        System.out.println(res);
    }
}

Compiler output:
Main.java:10: error: <identifier> expected
            char c = s.(i);
                       ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
 
public class Main {
 
	public static void main(String[] args) throws Throwable {
		BufferedReader vd = new BufferedReader(new InputStreamReader(System.in));
    String cd= vd.readLine()
    String[] s = cd.split("");
    int sum =0;
    for(int i=0;i<s.length;i++){
      sum=sum+Integer.parseInt(s[i]);
    }
    int p = Integer.parseInt(cd);
    if(p%sum==0) System.out.println("Yes");;
    if(p%sum!=0) System.out.println("No");
  }
}

Compiler output:
Main.java:8: error: ';' expected
    String cd= vd.readLine()
                            ^
1 error
Language: Java

public class abc01 {
    public static void main(String[] args)
    {
        int T_num = 0;
        String S = new java.util.Scanner(System.in).nextLine();
        for(int i=0; i<4; i++)
        {
            char testr = S.charAt(i);
            if(testr == '+')
            {
                T_num++;
            }
            else if(testr == '-')
            {
                T_num--;
            }

        }
        System.out.println(T_num);
    }
}


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

import java.util.Scanner;

public class Main {
  public static void main (String[] args) {
     Scanner input = new Scanner(System.in);
  
     while (input.hasNext()) {
        String S = input.next();
        int ans = 0;
       
        for (int i = 0; i < S.length(); ++i) {
          if (S.charAt('-')) {
            --ans;
          } else if (S.charAt('+')) {
            ++ans;
          }
        }
      }
  }
}

Compiler output:
Main.java:12: error: incompatible types: char cannot be converted to boolean
          if (S.charAt('-')) {
                      ^
Main.java:14: error: incompatible types: char cannot be converted to boolean
          } else if (S.charAt('+')) {
                             ^
2 errors
Language: C++

#include<stdio.h>
int main(void)
{
	int S = 0;
	int a, b, c, d;
	int e = +;

	scanf("%d%d%d%d", a, b, c, d);

	if (a = e) {
		S++;
	}
	else {
		S--;
	}
	if (b = e) {
		S++;
	}
	else {
		S--;
	}

	if (c = e) {
		S++;
	}
	else {
		S--;
	}

	if (d = e) {
		S++;
	}
	else {
		S--;
	}
	printf("%d", &S);
	return 0;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: expected primary-expression before ';' token
    6 |         int e = +;
      |                  ^
Language: C++

#include <cstdio>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;

int main()
{
    char str[5];
    while(gets(str)!=NULL)
    {
        int res=0;
        for(int i=0;str[i]!='\0';i++)
        {
            if(str[i]=='-')
                res--;
            else if(str[i]=='+')
                res++;
        }
        printf("%d\n",res);
    }
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
   11 |     while(gets(str)!=NULL)
      |           ^~~~
      |           getw
Language: Java

import java.util.Scanner;

public class Main {
  public static void main {
     Scanner input = new Scanner(System.in);
  
     while (input.hasNext()) {
        String S = input.next();
        int ans = 0;
       
        for (int i = 0; i < S.length(); ++i) {
          if (S.charAt('-')) {
            --ans;
          } else if (S.charAt('+')) {
            ++ans;
          }
        }
      }
  }
}

Compiler output:
Main.java:4: error: '(' expected
  public static void main {
                          ^
1 error
Language: Java

import java.util.Scanner;

public class Problem1 {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String str = in.next();
		int num = 0;
		for(int i=0;i<4;i++) {
			char nowChar = str.charAt(i);
			if(nowChar=='+') {
				num++;
			}else if(nowChar=='-') {
				num--;
			}
		}
		System.out.println(num);
	}
}

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

#include<stdio>
int main()
{
    char a[4];
    int n=0,i;
    scanf("%s",&a);
    for(i=0;i<4;i++)
    {
          if(a[i]=='+')
          {
               n++;
          }
          else
          {
              n--;    
          }
    }           
    printf("%d",n);
    return 0;   
} 

Compiler output:
a.cc:1:9: fatal error: stdio: No such file or directory
    1 | #include<stdio>
      |         ^~~~~~~
compilation terminated.
Language: C++

#include <iostream>
using namespace std;
int main{
string S;
cin>>S;
int a=0;
for(int i=0;i<4;i++){
if(S[i]=='+')a++;
if(S[i]=='-')a--;
cout<<a<endl;
}
   return 0;
}

Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main{
      |     ^~~~
a.cc:4:8: error: expected primary-expression before 'S'
    4 | string S;
      |        ^
a.cc:4:8: error: expected '}' before 'S'
a.cc:3:9: note: to match this '{'
    3 | int main{
      |         ^
a.cc:5:1: error: 'cin' does not name a type
    5 | cin>>S;
      | ^~~
a.cc:7:1: error: expected unqualified-id before 'for'
    7 | for(int i=0;i<4;i++){
      | ^~~
a.cc:7:13: error: 'i' does not name a type
    7 | for(int i=0;i<4;i++){
      |             ^
a.cc:7:17: error: 'i' does not name a type
    7 | for(int i=0;i<4;i++){
      |                 ^
a.cc:12:4: error: expected unqualified-id before 'return'
   12 |    return 0;
      |    ^~~~~~
a.cc:13:1: error: expected declaration before '}' token
   13 | }
      | ^
Language: Java

import java.util.Scanner;

public class Main {
  public static void main {
     Scanner input = new Scanner(System.in);
  
     while (input.hasNext()) {
        String S = input.next();
        int ans = 0;
       
        for (int i = 0; i < S.length(); ++i) {
          if (S.charAt('-')) {
            --ans;
          else if (S.charAt('+')) {
            ++ans;
          }
        }
      }
  }
}

Compiler output:
Main.java:4: error: '(' expected
  public static void main {
                          ^
Main.java:14: error: 'else' without 'if'
          else if (S.charAt('+')) {
          ^
Main.java:20: error: reached end of file while parsing
}
 ^
3 errors
Language: C++

#include<stdio>
int main()
{
    char a[4];
    int n=0,i;
    scanf("%s",&s);
    for(i=0;i<4;i++)
    {
          if(a[i]=='+')
          {
               n++;
          }
          else
          {
              n--;    
          }
    }           
    printf("%d",n);
    return 0;   
} 

Compiler output:
a.cc:1:9: fatal error: stdio: No such file or directory
    1 | #include<stdio>
      |         ^~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>

using namespaces std;

string s;
int t,i;

int main(){
     getline(cin,s);
for(i=0;i<=s.length()-1;i++){
if(s[i]=='+')t++;
else t--;
printf("%d",t);
return 0;
}

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'namespaces'
    3 | using namespaces std;
      |       ^~~~~~~~~~
a.cc:5:1: error: 'string' does not name a type; did you mean 'stdin'?
    5 | string s;
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:9:14: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |      getline(cin,s);
      |              ^~~
      |              std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:18: error: 's' was not declared in this scope
    9 |      getline(cin,s);
      |                  ^
a.cc:15:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:8:11: note: to match this '{'
    8 | int main(){
      |           ^
Language: C++

#include <stdio.h>
#include <stdlib.h>

int main()
{
    char s[4];
    gets(s);
    int a=0,i;
    for(i=0;i<4;i++)
    {
        if(s[i]=='-')
        {
            a--;
        }
        if(s[i]=='+')
            a++;

    }
    printf("%d\n",a);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    7 |     gets(s);
      |     ^~~~
      |     getw
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
 
public class Main {
 
	public static void main(String[] args) throws IOException {
		BufferedReader vd = new BufferedReader(new InputStreamReader(System.in));
		String[] s = vd.readLine().split("");
    	int sum=0;
  	  for(int i=0;i<4;++i){
 	     if(s[i]=="+")sum=sum+1;
 	     if(s[i]=="=")sum=sum-1;
  	  }
    System.out.println(sum);
 
  }
}

Compiler output:
Main.java:6: error: cannot find symbol
	public static void main(String[] args) throws IOException {
	                                              ^
  symbol:   class IOException
  location: class Main
1 error
Language: C

#include <stdio.h>

int main(){
	char s[4];
  	int i = 0;
  	int k = 0;
  	for(i = 0; i < 4; i++)
      scanf("%c"&s[i]);
  	i = 0;
  	while(i < 4){
      if(s[i] == '+')
        k = k + 1;
      else if(s[i] == '-')
        k = k - 1;
      else
        
      i++;
	}
  	printf("%d",k);
  	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:17: error: invalid operands to binary & (have 'char *' and 'int')
    8 |       scanf("%c"&s[i]);
      |             ~~~~^~~~~
      |             |     |
      |             |     char
      |             char *
Language: C++

#include<stdio.h>
int main(void)
{
	int S=0;
	int a, b, c, d;
	int e= +; 

	scanf("%d%d%d%d", a, b, c, d);

	if (a = e) {
		S++;
	}
	else {
		S--;
	}
	if (b= e) {
		S++;
	}
	else {
		S--;
	}

	if (c = e) {
		S++;
	}
	else {
		S--;
	}

	if (d = e) {
		S++;
	}
	else {
		S--;
	}
	printf("%d", &S);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: expected primary-expression before ';' token
    6 |         int e= +;
      |                 ^
Language: C++

#include<cstdio>
#include<cstring>
using namespace std;
char s[10];
int main(){
	gets(s);
	int ans=0,n=strlen(s);
	for (int i=0;i<n;i++) 
	if (s[i]=='+') ans++;else ans--;
	printf("%d",ans);
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
    6 |         gets(s);
      |         ^~~~
      |         getw
Language: C

#include <iostream>
#include <string>
#include <cmath>
#include <iomanip>
#include <algorithm>
#include <cstdio>
#include <cstring>
#define MOD 1e+9 + 9


int main(){
    int n;
    char s[5];
    for(int i = 0; i < 4; i++){
        scanf("%c",&s[i]);
    }
    for(int i = 0; i < 4; i++){
        if(s[i] == '+'){
            n++;
        }else{
            n--;
        }
    }
    
    printf("%d",n);
   return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.