criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.Scanner;

public class Main {

    public void main(String[] args) {

       Scanner scanner = new Scanner(System.in);
       String A = scanner.next();
       int ans = 0;

       for(int i = 1; i < 4; i++) {

       		if(A.substring(i,i+1).equals("+")) {
       			ans++;
       		}else {
       			ans--;
       		}
       }
       System.out.println(ans);

    }


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

import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
        Main main = new Main();
        main.solve(args);
    }

    public void solve(String[] args) {
        MyScanner scanner = new MyScanner();
        String A = scanner.next();
        int ans = 0;

        for(int i = 1; i < 4; i++) {

        		if(A.substring(i,i+1).equals("+")) {
        			ans++;
        		}else {
        			ans--;
        		}
        }
        System.out.println(ans); 
	}
 
}

Compiler output:
Main.java:11: error: cannot find symbol
        MyScanner scanner = new MyScanner();
        ^
  symbol:   class MyScanner
  location: class Main
Main.java:11: error: cannot find symbol
        MyScanner scanner = new MyScanner();
                                ^
  symbol:   class MyScanner
  location: class Main
2 errors
Language: Java

import java.util.Scanner;


public class EatingSymblsEasy {

	public static void main(String[] args) {

		Scanner scanner=new Scanner(System.in);
		String S=scanner.next();

		int kotae=0;

		for(int i=0;i<4;i++) {
			if(S.substring(i,i+1).equals("+")) {//Stringは参照型。文字の中身の比較をするのは.equals
				kotae++;
			}else {
				kotae--;
			}

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

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

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner scanner = new Scanner(System.in);

		String S = scanner.next();

		int seikai = 0;


		for (int i = 0; i <=3; i++) {

		if(S.substring(i,i+1).equals("+")) {    //文字列の中身だけ比較する

			 seikai++ ;
		}

			else {

			seikai-- ;
		}

		System.out.println(seikai);
}

}

}

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

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve(args);
    }

    public void solve(String[] args) {
        MyScanner scanner = new MyScanner();
        String A = scanner.next();
        int ans = 0;

        for(int i = 1; i < 4; i++) {

        		if(A.substring(i,i+1).equals("+")) {
        			ans++;
        		}else {
        			ans--;
        		}
        }
        System.out.println(ans);

     }


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

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ//

		Scanner scanner = new Scanner (System.in);

		String S = scanner.next();

		int seikai = 0;


		for (int i = 0; i < 4; i++) {

		if(S.substring(i,i+1).equals("+")) {    //文字列の中身だけ比較する

			 seikai++ ;
		}

			else {

			seikai-- ;
		}

		System.out.println(seikai);
}

}

}

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

import java.util.Scanner;

public class Maina {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
	    String S = scanner.next();
	    
	    int kotae = 0;
	    
	    for(int i=0; i<=3; i++) {
	    	if(S.substring(i, i+1).equals("+")) {
	    		kotae++;
	    	}else {
	    		kotae--;
	    	}
	    }
	    System.out.println(kotae);

	}

}

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

#include"bits/stdc++.h"
using namespace std;
int main(){
  int 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:8:10: error: request for member 'at' in 's', which is of non-class type 'int'
    8 |     if(s.at(i)=='+'){
      |          ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long 
#define mem(x,y) for(int i=0;i<x.size()i++){ x[i]=y; }
#define fo(i, l, r)  for((i) = (l); (i) < (r); (i)++)
#define fok(i,r,k)  for((i) = 0; (i) < (r); (i)=i+(k))
#define prnt(a,n)  { for(int i=0;i<n;i++){ cout<<a[i]<<" "; } cout<<endl; } 
#define mp make_pair
#define pb push_back
#define pi pair<int,int> 
#define pll pair<long long,long long>
#define vi vector<int> 
#define vl vector<long long>
#define vpl vector<pair<long long,long long>> 
#define vpi vector<pair<int,int>> 
#define all(x) x.begin(),x.end()
#define f first
#define s second
#define br cout<<endl;
#define io { freopen("input.txt","r",stdin);  freopen("output.txt","w",stdout); }
ll modexpo(ll x,ll y,ll m){    x=x%m;if(y==0){return 1;}if(y%2==0){return modexpo(x*x,y/2,m); }else{    return  (x*modexpo(x*x,y/2,m))%m; }}
const int mod  = 1e9+7;
const int maxn = 1e5 + 10;

string s;int ans = 0; 
int main()
{
fastio; 
cin>>s;
int i,j;
fo(i,0,s.size())
{
    if(s[i]=='-'){ ans--; }
    else ans++:
}
cout<<ans;
return 0;
}
//g++ -g a.cpp -o a.exe

Compiler output:
a.cc: In function 'int main()':
a.cc:35:15: error: expected ';' before ':' token
   35 |     else ans++:
      |               ^
      |               ;
Language: C++

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

cout << a << endl;

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:1: error: 'string' was not declared in this scope
    4 | string S;
      | ^~~~~~
a.cc:4:1: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 | cin >> S;
      | ^~~
      | std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:8: error: 'S' was not declared in this scope
    7 | cin >> S;
      |        ^
a.cc:15:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 | cout << a << 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:15:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 | cout << a << endl;
      |              ^~~~
      |              std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<bit/stdc++.h>
int main()
{
string S;
int a=0;
  
cin >> S;
  
  for(int i=0;i<4;++i)
  {
  if(S[i]=='+') ++a;
  else if(S[i]=='-') --a;
  }

cout << a << endl;

return 0;
}

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

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

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

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

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

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

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

#include<stdio.h>
 
int main()
{
 int n,sn=0,t,r;
 scanf("%d",&t);
 n=t;
 while(t>0)
 {
 sn+=t%10;
 t=t/10;
 }
 
 if(n%sn==0)
 {
     printf("Yes");
 }
 else
 {
     printf("No");
 }
    return 0;
}
#include<stdio.h>

int main()
{
 int n,sn=0,t,r;
 scanf("%d",&t);
 n=t;
 while(t>0)
 {
 sn+=t%10;
 t=t/10;
 }

 if(n%sn==0)
 {
     printf("Yes");
 }
 else
 {
     printf("No");
 }
    return 0;
}

Compiler output:
main.c:26:5: error: redefinition of 'main'
   26 | int main()
      |     ^~~~
main.c:3:5: note: previous definition of 'main' with type 'int()'
    3 | int main()
      |     ^~~~
Language: C

#include<stdio.h>
 
int main()
{
 int n,sn=0,t,r;
 scanf("%d",&t);
 n=t;
 while(t>0)
 {
 sn+=t%10;
 t=t/10;
 }
 
 if(n%sn==0)
 {
     printf("Yes");
 }
 else
 {
     printf("No");
 }
    return 0;
}
#include<stdio.h>

int main()
{
 int n,sn=0,t,r;
 scanf("%d",&t);
 n=t;
 while(t>0)
 {
 sn+=t%10;
 t=t/10;
 }

 if(n%sn==0)
 {
     printf("Yes");
 }
 else
 {
     printf("No");
 }
    return 0;
}
提出情報

Compiler output:
main.c:26:5: error: redefinition of 'main'
   26 | int main()
      |     ^~~~
main.c:3:5: note: previous definition of 'main' with type 'int()'
    3 | int main()
      |     ^~~~
main.c:47:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
   47 | 提出情報
      | ^~~~~~~~
Language: C++

#include <string>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'cin' was not declared in this scope
   10 |   cin >> s;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <string>
  +++ |+#include <iostream>
    2 | 
a.cc:15:3: error: 'cout' was not declared in this scope
   15 |   cout << ans << endl;
      |   ^~~~
a.cc:15:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:18: error: 'endl' was not declared in this scope
   15 |   cout << ans << endl;
      |                  ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <string>
  +++ |+#include <ostream>
    2 |
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 << ans << endl;
}


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

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;
 
int main() {
    string s;
    cin >> s;

    ll ans = 0;
    rep(i, s.size()) {
        if(s[i] == '+') {
            ans++
        }
        else {
            ans--;
        }
    }
    
    out(ans);
    re0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:18: error: expected ';' before '}' token
   39 |             ans++
      |                  ^
      |                  ;
   40 |         }
      |         ~
Language: C++

from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations

S = input()

def solve(S):
    a = 0
    return S.count("+") - S.count("-")

print(solve(S))

Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from fractions import gcd
      | ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <iomanip>
using namespace std;
using ll = long long;
#define pi 3.1415926
 
int a[3];
 
int main(){
    string s;
    cin >> s;
    int x = 0;
    for(int i = 0; i < 4; i++){
        if(s[i] == "+")
            x++;
        else 
            x--;
    }
    cout << x;

}

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

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

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


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

import java.util.*;
import java.io.*;

public class Main {
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		int ans = 0;
		for(int i = 0; i<s.length(); i++) {
			if(s.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.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.*;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
    4 | public class Main {
      | ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
string S;
  cin>>S;
 int count =0; 

  for(int i=0;i<S.size();i++){
  if(S.at(i)=="+"){
    count+=1;


}
  if(S.at(i)=="-"){
  count-=1;
  }
  }
  cout<<count<<endl;
}


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

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

#define rep(i,n) for (int i = 0; i< (n); ++i)
#define vvec(m,n) vector<vector<int>> (int(m), vector<int>(n))
#define ALL(a) (a).begin(), (a).end()

using ll = long long;

int main(){
    string s;
    cin >> s;
    int ans = 0;
    rep(char c:s){
        if(s == '+') ans++;
        else ans--;
    }
    cout << ans << endl;
}

Compiler output:
a.cc:14:17: error: macro "rep" requires 2 arguments, but only 1 given
   14 |     rep(char c:s){
      |                 ^
a.cc:4:9: note: macro "rep" defined here
    4 | #define rep(i,n) for (int i = 0; i< (n); ++i)
      |         ^~~
a.cc: In function 'int main()':
a.cc:14:5: error: 'rep' was not declared in this scope
   14 |     rep(char c:s){
      |     ^~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: lvalue required as decrement operand
    8 |     if(s[i]=='-')o----;
      |                  ~^~
Language: C++

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

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

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int count = 0;
  string S;
  cin >> S;
  char c;
  for(i = 0; i < 4; i++){
    c = S.at(i);
    if (s == '+'){
      count += 1;
    }
    else{
      count -= 1;
    }
  }
  cout << count << 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++){
      |       ^
a.cc:11:9: error: 's' was not declared in this scope
   11 |     if (s == '+'){
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int count = 0;
  string S;
  cin >> S;
  vector<char> c[4];
  for(int i = 0; i < 4; i++){
    s = S.at(i);
    if (s == '+'){
      count += 1;
    }
    else{
      count -= 1;
    }
  }
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 's' was not declared in this scope
   10 |     s = S.at(i);
      |     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int count = 0;
  string S;
  cin >> S;
  vector<char> c[4];
  for(i = 0; i < 4; i++){
    s = S.at(i);
    if (s == '+'){
      count += 1;
    }
    else{
      count -= 1;
    }
  }
  cout << count << 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++){
      |       ^
a.cc:10:5: error: 's' was not declared in this scope
   10 |     s = S.at(i);
      |     ^
Language: C++

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

int main () {
  string N;
  cin >> N;
  int cnt = 0;
  for (int i = 0; i < N.length(); ++i) {
    cnt += (int)N[i];
  }
  if ((long long)N % cnt == 0) cout << "Yes";
  else cout << "No";    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'long long int'
   11 |   if ((long long)N % cnt == 0) cout << "Yes";
      |       ^~~~~~~~~~~~
Language: C++

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

int main () {
  string S;
  cin >> S;
  int cnt = 0;
  
  for (int i = 0; i < S.length(); ++i) {
    if (s[i] == '+') cnt++;
    else cnt--;
  }
  cout << cnt;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 's' was not declared in this scope
   10 |     if (s[i] == '+') cnt++;
      |         ^
Language: C++

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

int main(){
  int x=0;
  string s;
  cin>>s;
  for(int i=0;i<3;i++){
    if(s.at(i)=="+") x++;
    else x--;
  }
  cout<<x<,endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     if(s.at(i)=="+") x++;
      |        ~~~~~~~^~~~~
a.cc:12:11: error: expected primary-expression before ',' token
   12 |   cout<<x<,endl;
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;cin>>s;
  ll ans = 0;
  for(auto a:s){
    if(a == '+')ans++;
    else ans--;
  }
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'll' was not declared in this scope
    5 |   ll ans = 0;
      |   ^~
a.cc:7:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
    7 |     if(a == '+')ans++;
      |                 ^~~
      |                 abs
a.cc:8:10: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |     else ans--;
      |          ^~~
      |          abs
a.cc:10:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma warning(disable : 4996)
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<time.h>
#include<random>
#include<array>


using namespace std;

#define REP(i, n) for(int i = 0;i < n;++i)
#define REPR(i, n) for(int i = n-1;i >= 0;--i)
#define FOR(i, m, n) for(int i = m;i < n;++i)
#define FORR(i, m, n) for(int i = m-1;i >= n;--i)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end())
#define ll long long
#define print(x) cout<<(x)<<'\n'
#define pe(x) cout<<(x)<<" "
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define lb(v,n) lower_bound(v.begin(), v.end(), (n))
#define ub(v,n) upper_bound(v.begin(), v.end(), (n))
#define int long long
//#define double long double
#define all(x) (x).begin(), (x).end()
#define print_space(v) REP(i,v.size())cout << v[i] << ((i == v.size() - 1) ? "\n" : " ")
template<typename T1, typename T2> inline void chmin(T1 & a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
typedef pair<int, int>P;
typedef array<int, 3> arr3;
std::random_device rd;
std::mt19937 mt(rd());
constexpr ll MOD = 998244353; constexpr int MAX = 2000020;
const double pi = acos(-1); constexpr double EPS = 1e-8;
constexpr ll INF = 1e18;
void y(bool cond) {
	if (cond)print("Yes");
	else print("No");
}

int A, B, C, D, E, X, Y, Z, M, N;
string S, T;
void solve() {
	cin >> S;
	int ans = 0;
	REP(i, ans.size()) {
		if (S[i] == '+')ans++;
		else ans--;
	}
	print(ans);
}


signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	//int q; cin >> q;
	//while (q--)
	solve();
}



Compiler output:
a.cc: In function 'void solve()':
a.cc:70:20: error: request for member 'size' in 'ans', which is of non-class type 'long long int'
   70 |         REP(i, ans.size()) {
      |                    ^~~~
a.cc:33:37: note: in definition of macro 'REP'
   33 | #define REP(i, n) for(int i = 0;i < n;++i)
      |                                     ^
Language: C++

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

int main(){
  string s;
  cin >> s;
  int a=0;
  for (auto i:s){
    if (i=='+') ++ans;
    else --ans;}
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |     if (i=='+') ++ans;
      |                   ^~~
      |                   abs
a.cc:10:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |     else --ans;}
      |            ^~~
      |            abs
a.cc:11:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: expected primary-expression before '}' token
   15 |         }
      |         ^
Language: C++

#include <bits/stdc++.h>

int main() {
	string s;
  	long i = 0;
	std::cin >> s;
  	for (int j = 0;j < 4;++j)
		if (s[j] == '+')
          ++i;
      	else
          --i;
	std::cout << i << std::endl;
}

Compiler output:
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/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:6:21: error: 's' was not declared in this scope
    6 |         std::cin >> s;
      |                     ^
Language: C++

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


Compiler output:
a.cc:3:1: error: expected unqualified-id before 'for'
    3 | for(int i=0;i<n;i++){
      | ^~~
a.cc:3:13: error: 'i' does not name a type
    3 | for(int i=0;i<n;i++){
      |             ^
a.cc:3:17: error: 'i' does not name a type
    3 | for(int i=0;i<n;i++){
      |                 ^
Language: C++

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

Compiler output:
a.cc:3:1: error: expected unqualified-id before 'for'
    3 | for(int i=0;i<n;i++){
      | ^~~
a.cc:3:13: error: 'i' does not name a type
    3 | for(int i=0;i<n;i++){
      |             ^
a.cc:3:17: error: 'i' does not name a type
    3 | for(int i=0;i<n;i++){
      |                 ^
Language: C++

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: expected unqualified-id before '.' token
    9 |     if(string.at(i)=='+')
      |              ^
Language: C++

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

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: 'n' was not declared in this scope
    8 |     s.size(n);
      |            ^
Language: C++

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

int main(){
    string s;
    s.resize(n);
    int a=0;
    cin >>s;
     for(int i=0;i<n;i++){
        if (s[i]=='+'){
        a++;
    }
    else{
        a--;
    }     
}
    
    
   cout <<a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: 'n' was not declared in this scope
    8 |     s.resize(n);
      |              ^
Language: C++

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

int main(){
    vector<string>v;
    int n;
    v.resize(n);
    int a=0;
    cin >>v;
    for (int i=0;i<n;i++){
     if (v[i]=='+'){
        a++;
    }
    else{
        a--;
    }   
}
    
   cout <<a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'vector' was not declared in this scope
    6 |     vector<string>v;
      |     ^~~~~~
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 | #include<string>
a.cc:6:18: error: expected primary-expression before '>' token
    6 |     vector<string>v;
      |                  ^
a.cc:6:19: error: 'v' was not declared in this scope
    6 |     vector<string>v;
      |                   ^
Language: C++

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

int main(){
    string S;
    S.resize(4);
    int a=0;
    if (S[i]=="+"){
        a++
    }
    else{
        a--;
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: 'i' was not declared in this scope
    9 |     if (S[i]=="+"){
      |           ^
a.cc:10:12: error: expected ';' before '}' token
   10 |         a++
      |            ^
      |            ;
   11 |     }
      |     ~
Language: C++

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

int main(){
    string S;
    S.size(4);
    int a=0;
    if (S[i]=="+"){
        a++
    }
    else{
        a--;
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: no matching function for call to 'std::__cxx11::basic_string<char>::size(int)'
    7 |     S.size(4);
      |     ~~~~~~^~~
In file included from /usr/include/c++/14/string:54,
                 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,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1076:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 1076 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
/usr/include/c++/14/bits/basic_string.h:1076:7: note:   candidate expects 0 arguments, 1 provided
a.cc:9:11: error: 'i' was not declared in this scope
    9 |     if (S[i]=="+"){
      |           ^
a.cc:10:12: error: expected ';' before '}' token
   10 |         a++
      |            ^
      |            ;
   11 |     }
      |     ~
Language: Java

import java.util.*;
public class Main{
 
  public static void main(String[] args){
   Scanner scanner = new Scanner(System.in);
    String S = scanner.nextLine();
    int mind = 0;
    for(String x : S){
      if(x.equals("+")){
      mind++;
      }else{
      mind--;
      }
    }
    System.out.println(mind);
  }
  
}

Compiler output:
Main.java:8: error: for-each not applicable to expression type
    for(String x : S){
                   ^
  required: array or java.lang.Iterable
  found:    String
1 error
Language: Java

ort java.util.*;
public class Main{
 
  public static void main(String[] args){
   Scanner scanner = new Scanner(System.in);
    String S = scanner.nextLine();
    int mind = 0;
    for(String x : S){
      if(x.equals("+")){
      mind++;
      }else{
      mind--;
      }
    }
    System.out.println(mind);
  }
  
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
ort java.util.*;
^
1 error
Language: Java

import java.util.*;
public class Main(){
 
  public static void main(String[] args){
   Scanner scanner = new Scanner(System.in);
    String S = scanner.nextLine();
    int mind = 0;
    for(String x : S){
      if(x.equals("+")){
      mind++;
      }else{
      mind--;
      }
    }
    System.out.println(mind);
  }
  
}

Compiler output:
Main.java:2: error: '{' expected
public class Main(){
                 ^
1 error
Language: C++

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

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
    7 |   ans = 0;
      |   ^~~
      |   abs
Language: C++

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

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   rep(i,4){
      |       ^
a.cc:8:3: error: 'rep' was not declared in this scope
    8 |   rep(i,4){
      |   ^~~
Language: C++

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

int main () {
  string S;
  cin >> S;
  int answer = 0;
  for(int i = 0; i < S.size; i++){
    if(S.at(i) == '+'){
      answer++;
    }
  }
  cout << answer - S.size + answer << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    8 |   for(int i = 0; i < S.size; i++){
      |                      ~~^~~~
      |                            ()
a.cc:13:22: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   13 |   cout << answer - S.size + answer << endl;
      |                    ~~^~~~
      |                          ()
Language: C++

#include <iostream>
#include <bits/stdc++.h>
int main(){
  char s[4];
  scanf("%s",&s);
  int ans=0;
  for(int 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:11:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |   cout<<ans<<endl;
      |   ^~~~
      |   std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:11:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 |   cout<<ans<<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)
      |     ^~~~
Language: C++

#include <iostream>
#include <bits/stdc++.h>
#include <string>
using namespace std;
int main(){
  char s[4];
  gets(s);
  int ans=0;
  for(int 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:3: error: 'gets' was not declared in this scope; did you mean 'getw'?
    7 |   gets(s);
      |   ^~~~
      |   getw
Language: C++

#include <iostream>
#include <bits/stdc++.h>
#include <string>
int main(){
  char s[4];
  gets(s);
  int ans=0;
  for(int 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:6:3: error: 'gets' was not declared in this scope; did you mean 'getw'?
    6 |   gets(s);
      |   ^~~~
      |   getw
a.cc:12:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |   cout<<ans<<endl;
      |   ^~~~
      |   std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:12:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 |   cout<<ans<<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)
      |     ^~~~
Language: C++

#include <iostream>
#include <bits/stdc++.h>

int main(){
  char s[4];
  gets(s);
  int ans=0;
  for(int i=0;i<4;i++){
    if(s[i]=='+') ans+=1;
    else ans-=1;
  }
  cout<<ans<<endl'
  return 0;
}

Compiler output:
a.cc:12:18: warning: missing terminating ' character
   12 |   cout<<ans<<endl'
      |                  ^
a.cc:12:18: error: missing terminating ' character
a.cc: In function 'int main()':
a.cc:6:3: error: 'gets' was not declared in this scope; did you mean 'getw'?
    6 |   gets(s);
      |   ^~~~
      |   getw
a.cc:12:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |   cout<<ans<<endl'
      |   ^~~~
      |   std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:12:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 |   cout<<ans<<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)
      |     ^~~~
Language: C++

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

int main() {
    int s;
    cin >> s;
    int count=0;
    for(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:9:14: error: request for member 'at' in 's', which is of non-class type 'int'
    9 |         if(s.at(i) == '+'){
      |              ^~
Language: C++

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

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

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


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

#include <iostream>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#define rep(i,n) for(int i = 0; i < n;i++)
#define ll long long
#include <bits/stdc++.h>
using namespace std;
#define mo 1000000007
#define ull unsigned long long 

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

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

#include<stdio.h>
int main (){
  char S[];
  int eat;
  scanf("%s",S);
  for (int i = 0; i <= 0; i++){
    if (S[i] == '+'){
      eat++;
    }else if (S[i]=='-'){
      eat--;
    }else{
      break;
    }
  }
  printf("%d",eat);
  return 0 ;
}


Compiler output:
main.c: In function 'main':
main.c:3:8: error: array size missing in 'S'
    3 |   char S[];
      |        ^
Language: C

#include<stdio.h>
int main {
  char S[];
  int eat;
  scanf("%s",S);
  for (int i = 0; i <= 0; i++){
    if (S[i] == '+'){
      eat++;
    }else if (S[i]=='-'){
      eat--;
    }else{
      break;
    }
  }
  printf("%d",eat);
  return 0 ;
}

Compiler output:
main.c:2:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    2 | int main {
      |          ^
Language: C++

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

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

    int num = 0;

    for (int i = 0; i < s.size(); i++){
        if (s.at(i) == "+"){
            num++;
        }
        else{
            num--;
        }
    }

    cout << num << endl;
}

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

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

int main(void){

  int N = 4;
  int num = 0;
  char s;

  while(scanf("%s", &s) != EOF) {
    if (s[0] == '+') {
      num += 1;
    } else if (s[0] == '-') {
      num -= 1;
    }
  }

  cout << num;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: invalid types 'char[int]' for array subscript
   12 |     if (s[0] == '+') {
      |          ^
a.cc:14:17: error: invalid types 'char[int]' for array subscript
   14 |     } else if (s[0] == '-') {
      |                 ^
Language: C++

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

int main(void){

  int N = 4;
  int num = 0;
  char s[N];

  // for ( int i = 0; i < N; i++) {
  //   cin >>
  // }
  while(scanf("%s", &s) != EOF) {
    if (s == '+') {
      num += 1;
    } else if (s == '-') {
      num -= 1;
    }
  }

  cout << num;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     if (s == '+') {
      |         ~~^~~~~~
a.cc:17:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |     } else if (s == '-') {
      |                ~~^~~~~~
Language: C++

#include <iostream>
using namespace std;

int main(void){

  int N = 4;
  int num = 0;
  char s[N];

  // for ( int i = 0; i < N; i++) {
  //   cin >>
  // }
  while(scanf("%s", &s) != EOF) {
    if (s == '+') {
      num += 1;
    } else if (s == '-') {
      num -= 1;
    }
  }

  cout << num;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if (s == '+') {
      |         ~~^~~~~~
a.cc:16:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |     } else if (s == '-') {
      |                ~~^~~~~~
Language: C++

#include <iostream>
using namespace std;

int main(void){

  int N = 4;
  int num = 0;
  char s[N];

  // for ( int i = 0; i < N; i++) {
  //   cin >>
  // }
  while(scanf("%c", &s) != EOF) {
    if (s == '+') {
      num += 1;
    } else if (s == '-') {
      num -= 1;
    }
  }

  cout << num;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if (s == '+') {
      |         ~~^~~~~~
a.cc:16:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |     } else if (s == '-') {
      |                ~~^~~~~~
Language: C++

#include <iostream>
using namespace std;

int main(void){

  int N = 4;
  char s[N];

  // for ( int i = 0; i < N; i++) {
  //   cin >>
  // }
  while(scanf("%c", &s) !=EOF) {
    if (s == '+') {
      num += 1;
    } else if (s == '-') {
      num -= 1;
    }
  }

  cout << num;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |     if (s == '+') {
      |         ~~^~~~~~
a.cc:14:7: error: 'num' was not declared in this scope; did you mean 'enum'?
   14 |       num += 1;
      |       ^~~
      |       enum
a.cc:15:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |     } else if (s == '-') {
      |                ~~^~~~~~
a.cc:16:7: error: 'num' was not declared in this scope; did you mean 'enum'?
   16 |       num -= 1;
      |       ^~~
      |       enum
a.cc:20:11: error: 'num' was not declared in this scope; did you mean 'enum'?
   20 |   cout << num;
      |           ^~~
      |           enum
Language: C++

#include <iostream>
using namespace std;

int main(void){

  int N = 4;
  int num = 0;

  // for ( int i = 0; i < N; i++) {
  //   cin >>
  // }
  while(scanf("%c", &s) !=EOF) {
    if (s == '+') {
      num += 1;
    } else if (s == '-') {
      num -= 1;
    }
  }

  cout << num;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: 's' was not declared in this scope
   12 |   while(scanf("%c", &s) !=EOF) {
      |                      ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: expected ';' before 'int'
    6 |   cin>>S
      |         ^
      |         ;
    7 |   int i=0;
      |   ~~~    
a.cc:10:7: error: 'i' was not declared in this scope
   10 |       i++;
      |       ^
a.cc:12:7: error: 'i' was not declared in this scope
   12 |       i--;
      |       ^
a.cc:15:9: error: 'i' was not declared in this scope
   15 |   cout<<i<<endl;
      |         ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: expected ';' before 'int'
    6 |   cin>>S
      |         ^
      |         ;
    7 |   int i=0;
      |   ~~~    
a.cc:9:13: error: 'i' was not declared in this scope
    9 |     if(S.at(i)=='+'){
      |             ^
a.cc:15:9: error: 'i' was not declared in this scope
   15 |   cout<<i<<endl;
      |         ^