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

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

}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'i' was not declared in this scope
    9 |   for(i=0;i<4;i++){
      |       ^
Language: C

#include<stdio.h>
int main(void){
  int s,i;
  int sum=0;
  
  for(i=0;i<4;i++){
    scanf("%d",&s);
    if(s==+)
      sum+=1;
    else if(s==-)
      sum-=1;
  }
  printf("%d",sum);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:12: error: expected expression before ')' token
    8 |     if(s==+)
      |            ^
Language: C++

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

int main(){
  string s;
  cin>>s;
  int count=0;
  fot(int i=0;i<4;i++){
    if(s.at(i)=='+'){
      count++;
    }
    else{
      count--;
    }
  }
    cout<<count<<endl;
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: expected primary-expression before 'int'
    8 |   fot(int i=0;i<4;i++){
      |       ^~~
a.cc:8:15: error: 'i' was not declared in this scope
    8 |   fot(int i=0;i<4;i++){
      |               ^
Language: Java

import java.util.*;

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

        System.out.println(count);
    }
}

Compiler output:
Main.java:9: error: cannot find symbol
            if('+' == S.carAt(i)){
                       ^
  symbol:   method carAt(int)
  location: variable S of type String
1 error
Language: Java

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int count = 0;
        String S = sc.next();
        for(int i = 0;i < S.length();i++){
            if(S.subString(i,i+1) == "+"){
                count++;
            } else count--;
        }

        System.out.println(count);
    }
}

Compiler output:
Main.java:9: error: cannot find symbol
            if(S.subString(i,i+1) == "+"){
                ^
  symbol:   method subString(int,int)
  location: variable S of type String
1 error
Language: Java

import java.util.*;

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

        System.out.println(count);
    }
}

Compiler output:
Main.java:9: error: bad operand types for binary operator '=='
            if(S.charAt(i) == "+"){
                           ^
  first type:  char
  second type: String
1 error
Language: Java

import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int count = 0;
        String S = sc.next();
        for(int i = 0;i < S.length();i++){
            if(s.charAt(i) == "+"){
                count++;
            } else count--;
        }

        System.out.println(count);
    }
}

Compiler output:
Main.java:9: error: cannot find symbol
            if(s.charAt(i) == "+"){
               ^
  symbol:   variable s
  location: class Main
1 error
Language: C++

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

int main(){
    int N;
    cin >> N;
    ostringstream ss;
    ss << N;
    string sn = ss.str();
    int sum = 0;
    for(int i = 0; i < sn.length(); i++){
        sum += atoi(sn[i]);
    }
    if(N % sum == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

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

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

int main(){
    int N;
    cin >> N;
    ostringstream ss;
    ss << N;
    string sn = ss.str();
    int sum = 0;
    for(int i = 0; i < sn.length(); i++){
        sum += ctoi(sn[i]);
    }
    if(N % sum == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: 'ctoi' was not declared in this scope; did you mean 'atoi'?
   12 |         sum += ctoi(sn[i]);
      |                ^~~~
      |                atoi
Language: C++

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

int main(){
    int N;
    cin >> N;
    string sn = to_string(N);
    int sum = 0;
    for(int i = 0; i < sn.length(); i++){
        sum += ctoi(sn[i]);
    }
    if(N % sum == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: 'ctoi' was not declared in this scope; did you mean 'atoi'?
   10 |         sum += ctoi(sn[i]);
      |                ^~~~
      |                atoi
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:25: error: expected ';' before ':' token
    7 |     if (s[i] == '+') c++:
      |                         ^
      |                         ;
Language: C++

#include <cstdio>
char s[10];
int c;
int main() {
  scanf("%s", s);
  for (int i = 0; i < 4; i++) {
    if (s[i] == '+') c++:
    else c--;
  }
  printf("%d",c);
  retrun 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:25: error: expected ';' before ':' token
    7 |     if (s[i] == '+') c++:
      |                         ^
      |                         ;
a.cc:11:3: error: 'retrun' was not declared in this scope
   11 |   retrun 0;
      |   ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string str;
  cin >> str;
  for(int i =0; i< str.size(); i++){
    int count=0;
    if(str.at(i) = "+"){
      count++;
    }
      else{
        count--;
      }
  }
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
    8 |     if(str.at(i) = "+"){
      |                    ^~~
      |                    |
      |                    const char*
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string str;
  cin >> str;
  for(int i =0; i< str.size(); i++){
    int count=0;
    if(str.at(i) =="+"){
      count++;
    }
      else{
        count--;
      }
  }
}
    


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

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  	string S;
  	int A=-4
  	cin >> S;
  	for(int i;i<4;i++){
      if (S[i]=='+'){
        A+=2;
      }
    }
  	cout << A;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: expected ',' or ';' before 'cin'
    7 |         cin >> S;
      |         ^~~
Language: C++

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


int main() {
 string S;
  cin >> S;
  int ans=0;
  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:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(void){
  int ans = 0;
  string op;
  
  cin >> op;
  
  for(int i=0 ; i < 4 ; i++){
    if(str[i] == '+') ans++;
    else if(str[i] == '-') ans--;
  }
  
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:8: error: 'str' was not declared in this scope; did you mean 'std'?
   13 |     if(str[i] == '+') ans++;
      |        ^~~
      |        std
Language: C

#include <stdio.h>

int main(){
  char s[4];
  int count_plus=0;
  Scanf("%s", s);

  for(int i=0;i<4;i++){
    if(s[i]=='+'){
      count_plus++;
    }
  }
  printf("%d\n", 2*count_plus - 4);
}

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

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

int main () {
  string s;
  cin >> s;
  int ans=0;
  for(int i=0;i<s.size();i++){
    if(s[i]=="+"){
      ans++;
    }
    else{
      ans--;
    }
  }
  cout << ans;
}
      

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
    8 |     if(s[i]="+")sum++;
      |             ^~~
      |             |
      |             const char*
Language: C++

#include <iostream>
#include <stdio.h>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <cstdlib>
using namespace std;
#define REP(i,n) for(int i = 0;i < (int)(n);i++);

int main() {
	char s;
	int a = 0;
	REP(i, 4) {
		cin >> s;
		if (s == '+') {
			a++;
		}
		else {
			a--;
		}
	}
	cout << ans << endl;
	return(0);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C++

#include<iostream>
using namespace std;

int main(void){
    string S;
    cin>>S;
    int ans=0;
    for(int i=0;i<S.size();i++){
        if(S[i]=='+')
            ans++;
        else if(S[i]==='-')
            ans--;
    }
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: expected primary-expression before '=' token
   11 |         else if(S[i]==='-')
      |                       ^
Language: C++

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

int main() {
  int cnt=0;
  vector<int> v;
  for (int i=0; i<v.size(); i++) {
    cin >> v[i];
    cnt=v[i]++;
  }
  if (N%cnt==0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'N' was not declared in this scope
   11 |   if (N%cnt==0) {
      |       ^
Language: Java

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner scanner= new Scanner(System.in);
        int N = scanner.nextInt();
        int m = 0;
        int L = String.value0f(N).length();
        for(int i = 1; i <= L; i++){
            int n = N % 10;
            m = m + n;
            if(N % m == 0){
                System.out.print("Yes");
            } else {
                System.out.println("No");
            }

        }
    }

}

Compiler output:
Main.java:7: error: cannot find symbol
        int L = String.value0f(N).length();
                      ^
  symbol:   method value0f(int)
  location: class String
1 error
Language: C++

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

int main(void)
{
    int count = 0
    string s;
    cin >> s;
    for(int i = 0; i < 4;i++)
    {
        if(s[i] == '+'){count++;}
        else{count--;}
    }
    cout << count << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: expected ',' or ';' before 'string'
   11 |     string s;
      |     ^~~~~~
a.cc:12:12: error: 's' was not declared in this scope
   12 |     cin >> s;
      |            ^
Language: C++

import java.util.Scanner;

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

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C

#include <stdio.h>

int main(){
    char S[4];
    int ans=0;

    scanf("%s",a);
    for (int 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:7:16: error: 'a' undeclared (first use in this function)
    7 |     scanf("%s",a);
      |                ^
main.c:7:16: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
  int ans,plus,minus;
  char S;
  cin >> S;
  plus = count(S.cbegin(),S.cend(),'+');
  minus = count(S.cbegin(),S.cend(),'-');
  ans = plus - minus;
  cout << ans <<"\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: request for member 'cbegin' in 'S', which is of non-class type 'char'
   10 |   plus = count(S.cbegin(),S.cend(),'+');
      |                  ^~~~~~
a.cc:10:29: error: request for member 'cend' in 'S', which is of non-class type 'char'
   10 |   plus = count(S.cbegin(),S.cend(),'+');
      |                             ^~~~
a.cc:11:19: error: request for member 'cbegin' in 'S', which is of non-class type 'char'
   11 |   minus = count(S.cbegin(),S.cend(),'-');
      |                   ^~~~~~
a.cc:11:30: error: request for member 'cend' in 'S', which is of non-class type 'char'
   11 |   minus = count(S.cbegin(),S.cend(),'-');
      |                              ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int count = 0;
  string s;
  cin >> s;
  for (int i = 0; i < 4; i++) {
    if (s.at(i) == '+') {
      count++;
    }
  }
  cout << 2 * count - 4
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: expected ';' before '}' token
   13 |   cout << 2 * count - 4
      |                        ^
      |                        ;
   14 | }
      | ~
Language: C++

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

  

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

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

string s;
int res = 0;
int main(){
  cin >> s;
  for(int i=0;i<4;i++){
    if(s[i]=="+")res++;
    else res--;
  } 
  cout << res<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     if(s[i]=="+")res++;
Language: C++

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

string s;
int res = 0;
int main(){
  cin >> s;
  for(int i=0;i<4;i++){
    if(s[i]=="+")res++;
    else res--;
    
  cout << res<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     if(s[i]=="+")res++;
a.cc:13:2: error: expected '}' at end of input
   13 | }
      |  ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'i' was not declared in this scope
    7 |   for(i=0;i<4;i++){
      |       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  int ans=0;
  cin>>s;
  for(i=0;i<4;i++){
    if(s[i]=="+"){
      ans+=1
    }
    else{
      ans-=1
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'i' was not declared in this scope
    7 |   for(i=0;i<4;i++){
      |       ^
a.cc:9:13: error: expected ';' before '}' token
    9 |       ans+=1
      |             ^
      |             ;
   10 |     }
      |     ~        
a.cc:12:13: error: expected ';' before '}' token
   12 |       ans-=1
      |             ^
      |             ;
   13 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define Abs(x)((x) < 0 ? (x) * -1 : (x))

#define rep(x, y) for ((x) = 0; (x) < (y); (x)++)
#define repin(x, y) for ((x) = 0; (x) <= (y); (x)++)
#define nep(x, y) for ((x) = (y) - 1; 0 <= (x); (x)--)
#define nepi(x, y, z) for ((x) = (y) - 1; (z) <= (x); (x)--)
#define repi(x, y, z) for ((x) = (z); (x) < (y); (x)++)
#define repiin(x, y, z) for ((x) = (z); (x) <= (y); (x)++)
#define reps(x, y, z) for ((x) = 0; (x) < (y); (x) += (z))
#define repis(x, y, z, s) for ((x) = (z); (x) < (y); (x) += (s))
#define repit(x) for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)
#define nepit(x) for (__typeof((x).rbegin()) it = (x).rbegin(); it != (x).rend(); it++)

#define All(x) (x).begin(),(x).end()

#define Mem0(x) memset(x, 0, sizeof(x))
#define Mem1(x) memset(x, -1, sizeof(x))

#define Unique(v) v.resize(unique(All(v)) - v.begin())

#define peq(p0, p1)(p0.first == p1.first && p0.second == p1.second)

#define End '\n'
#define Out(x) cout<<(x)<<End
#define OutP(p, sep, end) cout<<p.first<<sep<<p.second<<end

template<typename T> inline bool Max(T &x, const T &y) { return x < y ? x = y, 1 : 0; }
template<typename T> inline bool Min(T &x, const T &y) { return x > y ? x = y, 1 : 0; }
template<typename T> using V = vector<T>;
template<typename T> using VV = V<V<T> >;

#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define lb std::lower_bound
#define ub std::upper_bound

#define lbi(v, x) lb(All(v), (x))-v.begin()
#define ubi(v, x) ub(All(v), (x))-v.begin()

static const ll MOD = 1e9 + 7;
static const double PI = 3.141592653589793;

#define LOCAL 0

int main()
{
#if LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    freopen("debug.txt", "w", stderr);
#endif

    cin.tie(0);
    ios::sync_with_stdio(false);
	//std::cout.precision(18);

	string s;

	cin >> s;

	int n = 0;

	rep(i, 4) {
		if (s[i] == '+') n++;
		else n--;
	}

	Out(n);
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:72:13: error: 'i' was not declared in this scope
   72 |         rep(i, 4) {
      |             ^
a.cc:10:25: note: in definition of macro 'rep'
   10 | #define rep(x, y) for ((x) = 0; (x) < (y); (x)++)
      |                         ^
Language: C++

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

int main(){
  string S;
  int answer;
  answer=0;
  for(int count = 1; count <=4; count = count + 1){
    if(S[count-1]=="+"){
      answer = answer+1;
    }else{
      answer = answer-1;
    }
  }
  cout << answer <<  endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     if(S[count-1]=="+"){
Language: C++

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

int main(){
  string S;
  int answer;
  answer=0;
  for(int count = 1; count <=4; count = count + 1){
    if(S[count-1]== + ){
      answer = answer+1;
    }else{
      answer = answer-1;
    }
  }
  cout << answer <<  endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:23: error: expected primary-expression before ')' token
    9 |     if(S[count-1]== + ){
      |                       ^
Language: C++

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

int main(){
  string S;
  int answer;
  answer=0;
  for(count = 1; count <5; count = count + 1){
    if(S[count-1]=='+'){
      answer = answer+1;
    }else{
      answer = answer-1;
    }
  }
  cout << answer <<  endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: overloaded function with no contextual type information
    8 |   for(count = 1; count <5; count = count + 1){
      |               ^
a.cc:8:18: error: parse error in template argument list
    8 |   for(count = 1; count <5; count = count + 1){
      |                  ^~~~~~~~
a.cc:8:18: error: cannot resolve overloaded function 'count' based on conversion to type 'bool'
a.cc:8:42: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
    8 |   for(count = 1; count <5; count = count + 1){
      |                                    ~~~~~~^~~
a.cc:9:15: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
    9 |     if(S[count-1]=='+'){
      |          ~~~~~^~
Language: C++

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

int main(){
  string S;
  int answer;
  answer=0;
  for(count = 1; count <=4; count = count + 1){
    if(S[count-1]=='+'){
      answer = answer+1;
    }else{
      answer = answer-1;
    }
  }
  cout << answer <<  endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: overloaded function with no contextual type information
    8 |   for(count = 1; count <=4; count = count + 1){
      |               ^
a.cc:8:24: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<='
    8 |   for(count = 1; count <=4; count = count + 1){
      |                  ~~~~~~^~~
a.cc:8:43: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
    8 |   for(count = 1; count <=4; count = count + 1){
      |                                     ~~~~~~^~~
a.cc:9:15: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
    9 |     if(S[count-1]=='+'){
      |          ~~~~~^~
Language: C++

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

int main(){
  string S;
  int answer;
  answer=0;
  for(count = 1; count <=4; count = count + 1){
    if(S[count-1]=='+'){
      answer = answer+1
    }else{
      answer = answer-1
    }
  }
  cout << answer <<  endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: overloaded function with no contextual type information
    8 |   for(count = 1; count <=4; count = count + 1){
      |               ^
a.cc:8:24: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<='
    8 |   for(count = 1; count <=4; count = count + 1){
      |                  ~~~~~~^~~
a.cc:8:43: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
    8 |   for(count = 1; count <=4; count = count + 1){
      |                                     ~~~~~~^~~
a.cc:9:15: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator-'
    9 |     if(S[count-1]=='+'){
      |          ~~~~~^~
a.cc:10:24: error: expected ';' before '}' token
   10 |       answer = answer+1
      |                        ^
      |                        ;
   11 |     }else{
      |     ~                   
a.cc:12:24: error: expected ';' before '}' token
   12 |       answer = answer-1
      |                        ^
      |                        ;
   13 |     }
      |     ~
Language: C++

	int ans = 0;
	char c;

	for (int i = 0;i < 4;i++){
		cin >> c;
		ans += (c == '+'? 1 : -1);
	}

	cout << ans << endl;

	return 0;

}


Compiler output:
a.cc:4:9: error: expected unqualified-id before 'for'
    4 |         for (int i = 0;i < 4;i++){
      |         ^~~
a.cc:4:24: error: 'i' does not name a type
    4 |         for (int i = 0;i < 4;i++){
      |                        ^
a.cc:4:30: error: 'i' does not name a type
    4 |         for (int i = 0;i < 4;i++){
      |                              ^
a.cc:9:9: error: 'cout' does not name a type
    9 |         cout << ans << endl;
      |         ^~~~
a.cc:11:9: error: expected unqualified-id before 'return'
   11 |         return 0;
      |         ^~~~~~
a.cc:13:1: error: expected declaration before '}' token
   13 | }
      | ^
Language: C

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: invalid types 'char[int]' for array subscript
    7 |     if(s[i]='-')a--;
      |         ^
Language: C++

#include <iostream>
#include <string>

int EatingSymbolsEasy(void) {
	std::string line;
   std::cin >> line;

	const char* str = line.data();
	int res = 0;
	for (int i = 0; i < 4; i++) {
		if (str[i] == '+')
			res++;
		else
			res--;
	}
	std::cout << res;
	return 0;
}

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

#include <iostream>
#include <string>

int EatingSymbolsEasy(void) {
	std::string line;
   std::cin >> line;

	char* str = line.data();
	int res = 0;
	for (int i = 0; i < 4; i++) {
		if (str[i] == '+')
			res++;
		else
			res--;
	}
	std::cout << res;
	return 0;
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:28: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
    6 |     if(s[i]='+')a+=1;else a-=1;}
      |                           ~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string s,a=0;cin>>s;
  for(int i=0;i<4;i++)
    if(s[i]='+')a++;else a--;}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
    6 |     if(s[i]='+')a++;else a--;}
      |                 ~^~
a.cc:6:27: error: no 'operator--(int)' declared for postfix '--' [-fpermissive]
    6 |     if(s[i]='+')a++;else a--;}
      |                          ~^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string s,a=0;cin>>s;
  for(int i=0;i<4;i++)
    if(char[i]='+')a++;else a--;}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: expected unqualified-id before '[' token
    6 |     if(char[i]='+')a++;else a--;}
      |            ^
a.cc:6:21: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
    6 |     if(char[i]='+')a++;else a--;}
      |                    ~^~
a.cc:6:30: error: no 'operator--(int)' declared for postfix '--' [-fpermissive]
    6 |     if(char[i]='+')a++;else a--;}
      |                             ~^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string x;
  cin>>x;
  
  int ans=0;
  for(int i=0;i<4; i++){
    if(x[i]=="-"){
      ans--;
    }
    else{ans++;}
  }
  cout<<ans<<endl;
}
    


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


#include <iostream>
#include <cmath>
#include <string>
#include <typeinfo>
#include <climits>
#include <algorithm>
#include <cctype>
#include <stdio.h>
#include <cstdlib>
using namespace std;

int main(){
    char s[];
    cin >> s;
    cout << 0-count(s,s+4,'+')-count(s,s+4,'-');
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: storage size of 's' isn't known
   14 |     char s[];
      |          ^
Language: C++

s = list(map(str,input().split()))
count = 0
for i in range(4):
  if s == '+':
    count += 1
  else:
    count -= 1
print(count)

Compiler output:
a.cc:1:1: error: 's' does not name a type
    1 | s = list(map(str,input().split()))
      | ^
Language: C++

#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<bitset>
#include<unordered_map>
#include <climits>
#include<fstream>
using namespace std;
//---------------------------------------------------
//library zone!!!!!
typedef long long ll;
typedef long double ld;
#define rep(i,j) for(ll i=0;i<(long long)(j);i++)
#define all(a) (a).begin(),(a).end()
const ll Mod = 1000000007;
struct P {
	ll pos, cost;
};
bool operator<(P a, P b) { return a.cost < b.cost; }
bool operator>(P a, P b) { return a.cost > b.cost; }
struct B {
	ll to, cost;
};
struct E {
	ll from, to, cost;
};
bool operator<(E a, E b) {
	return a.cost < b.cost;
}
struct H {
	ll x, y;
};
bool operator<(H a, H b) {
	if (a.x != b.x) return a.x < b.x;
	return a.y < b.y;
}
bool operator>(H a, H b) {
	if (a.x != b.x) return a.x > b.x;
	return a.y > b.y;
}
bool operator==(H a, H b) {
	return a.x == b.x&&a.y == b.y;
}
bool operator!=(H a, H b) {
	return a.x != b.x || a.y != b.y;
}
ll gcd(ll i, ll j) {
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcm(j%i, i);
}
ld mod_pow(ld x, ll n, ll p) {
	ld res = 1;
	while (n > 0) {
		if (n & 1) res = res * x;
		x = x * x;
		n >>= 1;
	}
	return res;
}//x^n%p
const ll Inf = 3023372036854775807;
const int inf = 1500000000;
#define int long long
//----------------------------------------------------
//++++++++++++++++++++++++++++++++++++++++++++++++++++
signed main() {
	string s;
	cin>>s;
	int sum=0;
	for(int i=0;i<s.size();i++){
		if(s[i]=='+') sum++;
		else sum--;
	}
	cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'll gcd(ll, ll)':
a.cc:61:16: error: 'gcm' was not declared in this scope; did you mean 'gcd'?
   61 |         return gcm(j%i, i);
      |                ^~~
      |                gcd
Language: C++

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

int main()
{
  int s;
  cin >> s;
  int i, ans;
  ans = 0;
  for(i = 0; i < 4; i++)
  {
    if(s.at(i) == '+')
    {
      ans++;
    }
  }
  cout << ans * 2 - 4 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: request for member 'at' in 's', which is of non-class type 'int'
   12 |     if(s.at(i) == '+')
      |          ^~
Language: C++

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

string s;
int i,cnt=0;

int main(void){
  cin >> s;
  for(i=0 ; i<4 ; i++){
    if(s[i]=="-"){
      cnt--;
    }
    else{
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i]=="-"){
Language: C++

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

string s;
int i,cnt=0;

int main(void){
  cin >> s;
  for(i=0 ; i<4 ; i++){
    if(s[i]=="-"){
      cnt--;
    }
    else{
      cnt++;
    }
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i]=="-"){
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:8:15: note: to match this '{'
    8 | int main(void){
      |               ^
Language: C++

#include<iostream>
#include<string>
using namespace std:

string s;
int i,cnt=0;

int main(){
  cin >> s;
  for(i=0 ; i<4 ;i++){
    if(s[i]=="-"){
      cnt--;
    else{
      cnt++;
    }
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc:3:20: error: found ':' in nested-name-specifier, expected '::'
    3 | using namespace std:
      |                    ^
      |                    ::
a.cc:5:1: error: 'string' is not a namespace-name
    5 | string s;
      | ^~~~~~
a.cc:5:7: error: expected ';' before 's'
    5 | string s;
      |       ^~
      |       ;
a.cc:5:8: error: 's' does not name a type
    5 | string s;
      |        ^
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |   cin >> s;
      |   ^~~
      |   std::cin
In file included 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:10: error: 's' was not declared in this scope
    9 |   cin >> s;
      |          ^
a.cc:13:5: error: expected '}' before 'else'
   13 |     else{
      |     ^~~~
a.cc:11:18: note: to match this '{'
   11 |     if(s[i]=="-"){
      |                  ^
a.cc:16:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |   cout << cnt << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 |   cout << cnt << endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:8:11: note: to match this '{'
    8 | int main(){
      |           ^
Language: C++

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

string s;
int i,cnt=0;

int main(){
  cin >> s;
  for(i=0 ; i<4 ;i++){
    if(s[i]=="-"){
      cnt--;
    else{
      cnt++;
    }
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i]=="-"){
a.cc:13:5: error: expected '}' before 'else'
   13 |     else{
      |     ^~~~
a.cc:11:18: note: to match this '{'
   11 |     if(s[i]=="-"){
      |                  ^
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:8:11: note: to match this '{'
    8 | int main(){
      |           ^
Language: C++

#include<iostream>
#include(string>
using namespace std:

string s;
int i,cnt=0;

int main(){
  cin >> s;
  for(i=0 ; i<4 ;i++){
    if(s[i]=="-"){
      cnt--;
    else{
      cnt++;
    }
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc:2:9: error: #include expects "FILENAME" or <FILENAME>
    2 | #include(string>
      |         ^
a.cc:3:20: error: found ':' in nested-name-specifier, expected '::'
    3 | using namespace std:
      |                    ^
      |                    ::
a.cc:5:1: error: 'string' is not a namespace-name
    5 | string s;
      | ^~~~~~
a.cc:5:7: error: expected ';' before 's'
    5 | string s;
      |       ^~
      |       ;
a.cc:5:8: error: 's' does not name a type
    5 | string s;
      |        ^
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |   cin >> s;
      |   ^~~
      |   std::cin
In file included 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:10: error: 's' was not declared in this scope
    9 |   cin >> s;
      |          ^
a.cc:13:5: error: expected '}' before 'else'
   13 |     else{
      |     ^~~~
a.cc:11:18: note: to match this '{'
   11 |     if(s[i]=="-"){
      |                  ^
a.cc:16:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |   cout << cnt << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 |   cout << cnt << endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:8:11: note: to match this '{'
    8 | int main(){
      |           ^
Language: C++

#include<iostream>
#include(string>
using namespace std;

string s;
int i,cnt=0;

int main(){
  cin >> s;
  for(i=0 ; i<4 ;i++){
    if(s[i]=="-"){
      cnt--;
    else{
      cnt++;
    }
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc:2:9: error: #include expects "FILENAME" or <FILENAME>
    2 | #include(string>
      |         ^
a.cc: In function 'int main()':
a.cc:11:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i]=="-"){
a.cc:13:5: error: expected '}' before 'else'
   13 |     else{
      |     ^~~~
a.cc:11:18: note: to match this '{'
   11 |     if(s[i]=="-"){
      |                  ^
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:8:11: note: to match this '{'
    8 | int main(){
      |           ^
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {       
        
        Scanner sr = new Scanner(System.in);
		String s = sr.next().substring(0,4);
		int takashi_eat = 0;
		
		for(int i = 0; i < s.length(); i++){
			if(s.substring(i, i + 1).equals("+")){
				takashi_eat++;
			}else{
				takashi_eat--;
			}
		}
		System.out.println(c);
    }
}

Compiler output:
Main.java:17: error: cannot find symbol
		System.out.println(c);
		                   ^
  symbol:   variable c
  location: class Main
1 error
Language: C++

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

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

  int count = 0;
  for (int i = 0; i < 4; i ++) {
    if (s.at(i) == "+") {
      count ++;
    } else {
      cout --;
    }
  }

  cout << count << endl;
}


Compiler output:
a.cc:1:25: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++.h>;
      |                         ^
a.cc: In function 'int main()':
a.cc:10:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if (s.at(i) == "+") {
      |         ~~~~~~~~^~~~~~
a.cc:13:12: error: no 'operator--(int)' declared for postfix '--' [-fpermissive]
   13 |       cout --;
      |       ~~~~~^~
Language: C++

#include <stdio.h>
using namespace std;
int main(){
  char s[5];
  cin >>s;
  int ans=0;
  for(int i=0;i<4;i++){
    if(s[i]=='+')
      ans++;
    else
      ans--;
  }
  cout<<ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >>s;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <stdio.h>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:13:3: error: 'cout' was not declared in this scope
   13 |   cout<<ans;
      |   ^~~~
a.cc:13:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <stdio.h>
int main(){
  char s[5];
  cin >>s;
  int ans=0;
  for(int i=0;i<4;i++){
    if(s[i]=='+')
      ans++;
    else
      ans--;
  }
  cout<<ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin >>s;
      |   ^~~
a.cc:12:3: error: 'cout' was not declared in this scope
   12 |   cout<<ans;
      |   ^~~~
Language: C++

#include <stdio.h>
int main(){
  char s[5];
  cin >>s;
  int ans=0;
  for(int i=0;i<4;i++){
    if(s[i]=='+')
      ans++;
    else
      ans--;
  }
}

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

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)  
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

int main(){

  int s;
  cin>>s;
  int ans = 0;
  REP(i,4){
    if(s[i]=='+'){
      ans++;
    }else{
      ans--;
    }
  }
cout<<ans<<endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:9: error: invalid types 'int[int]' for array subscript
   26 |     if(s[i]=='+'){
      |         ^
Language: C++

#!/bin/bash
 
read a
echo $a | awk '{print 4 - 2 * gsub("-", "a")}'
 

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #!/bin/bash
      |  ^
a.cc:4:15: warning: multi-character literal with 30 characters exceeds 'int' size of 4 bytes
    4 | echo $a | awk '{print 4 - 2 * gsub("-", "a")}'
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:3:1: error: 'read' does not name a type
    3 | read a
      | ^~~~
Language: C++

#include <iostream>

using namespace std;

int main(){
 char S[4+2];
 int i = 0;
 int C = 0;
 cin >> S;
 for(i = 0; i  < 5; i++){
  if(S[i]==43){
C++;
}else (S[i]==45){
C--;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: expected ';' before '{' token
   13 | }else (S[i]==45){
      |                 ^
      |                 ;
a.cc:16:2: error: expected '}' at end of input
   16 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
char s[4];
int a=0;
int main()
{
    for (size_t i = 0; i < 4; i++) {
        /* code */
        scanf("%s\n",s[i] );
        if (s[i]=="+") a++;
        else a--;
        printf("%d\n",a ); 

}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         if (s[i]=="+") a++;
      |             ~~~~^~~~~
a.cc:14:2: error: expected '}' at end of input
   14 | }
      |  ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S;
  cin >> S;
  int a=0;
  for(int i=0;i<4;i++){
    if(S[i]=="+"){a++;}
    else{a--;}
  }
  cout << a << endl;
}

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

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

int main(){
  string n;cin>>n;int a=0;
  for(int i;i<4;i++){
    if(n[i]=="+")a++;
    else{a--;}}
  cout<<a<<endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |     if(n[i]=="+")a++;
Language: C++

#include <iostream>
using namespace std;

int main(int argc, char *argv[])
{
	int i;
	int result = 0;
    char str[8];

	cin >> str;
	while (i = 0; i < 4; i++) {
		if (str[i] == '+') {
			result++;
		} else {
			result--;
		}
	}

	cout << result << endl;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:11:21: error: expected ')' before ';' token
   11 |         while (i = 0; i < 4; i++) {
      |               ~     ^
      |                     )
a.cc:11:33: error: expected ';' before ')' token
   11 |         while (i = 0; i < 4; i++) {
      |                                 ^
      |                                 ;
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main() {
  int S;
  cin>>S;
  
  int ans=0;
  for(int i=0;i<4;++i){
    if(S[i]=='+')
      ++ans;
    if(S[i]='-')
      --ans;
  }
  
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: invalid types 'int[int]' for array subscript
   12 |     if(S[i]=='+')
      |         ^
a.cc:14:9: error: invalid types 'int[int]' for array subscript
   14 |     if(S[i]='-')
      |         ^
Language: C++

#include <iostream>
 
int main()
{
	int N;
	int sum = 0;
cin >> N;
       int tmp = N;
while(tmp>0){
sum=sum+tmp%10;
tmp=tmp/10;
}
if( N%sum==0){
cout<<"Yes"<<endl;
}else{
cout<<"No"<<endl;
}



	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 | cin >> N;
      | ^~~
      | std::cin
In file included 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:14:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 | cout<<"Yes"<<endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:14:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 | cout<<"Yes"<<endl;
      |              ^~~~
      |              std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:16:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 | cout<<"No"<<endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:13: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 | cout<<"No"<<endl;
      |             ^~~~
      |             std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~