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

#include<cstdio>

int main()
{
  char S[10];
  scanf('%s', S);

  int ans = 0;
  for (int i = 0; i < 4; ++i){
    if (S[i] == '+') ++ans;
    else --ans;
  }
  printf('%d\n', ans);
  return 0;
}

Compiler output:
a.cc:6:9: warning: multi-character character constant [-Wmultichar]
    6 |   scanf('%s', S);
      |         ^~~~
a.cc:13:10: warning: multi-character character constant [-Wmultichar]
   13 |   printf('%d\n', ans);
      |          ^~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
    6 |   scanf('%s', S);
      |         ^~~~
      |         |
      |         int
In file included from /usr/include/c++/14/cstdio:42,
                 from a.cc:1:
/usr/include/stdio.h:428:42: note:   initializing argument 1 of 'int scanf(const char*, ...)'
  428 | extern int scanf (const char *__restrict __format, ...) __wur;
      |                   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:13:10: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   13 |   printf('%d\n', ans);
      |          ^~~~~~
      |          |
      |          int
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

#include<cstdio>

int main()
{
  char S[10];
  scanf("%s", S);

  int ans = 0;
  for (int i = 0; i < 4; ++i){
    if (S[i] == "+") ++ans;
    else --ans;
  }
  printf("%d\n", ans);
  return 0;
}

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

#include<iostream>
#include<algorithm>

using namespace std;

int main(){
  string S;
  int t = 0;
  cin >> S;
  for (i = S.begin(); i != S.end(); i++){
    if(i = "+"){
      t = t + 1;
    }
    else {
      t = t - 1;
    }
  }
  cout << t << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: 'i' was not declared in this scope
   10 |   for (i = S.begin(); i != S.end(); i++){
      |        ^
Language: C

/* 問題文
 * 高橋君は，いつも頭の中に整数を 1 つ思い浮かべています．
 * 
 * はじめ，高橋君が思い浮かべている整数は 0 です． これから，高橋君は + または - の記号を，あわせて 4 つ食べようとしています． 高橋君が + を食べると，思い浮かべている整数は 1 大きくなります． 一方，高橋君が - を食べると，思い浮かべている整数は 1 小さくなります．
 * 
 * 高橋君が食べようとしている記号は，文字列 S で与えられます． S の i 文字目は，高橋君が i 番目に食べる記号です．
 * 
 * すべての記号を食べ終わった後，高橋君が思い浮かべている整数を求めてください．
 * 
 * 制約
 * S の長さは 4
 * S の各文字は + または */

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

int main(){
    int ans = 0;
    char *line = readline("");
    
    while(*line != '\0'){
        if(*line == '+'){
            ans++;
        }
        else{
            ans--;
        }
        line++;
    }

    free(line);

    return 0;
}


Compiler output:
main.c:16:10: fatal error: readline/readline.h: No such file or directory
   16 | #include <readline/readline.h>
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
using namespace std;

int main(){
  int N=0;
  string S;
  cin>>S;
  for(int i=0;i<4;i++){
  if(S.at(i)=="+"){
  N++;
  }
    else{
    N--;
    }
  }
  cout<<N<<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)=="+"){
      |      ~~~~~~~^~~~~
Language: C++

#include<iostream>
using namespace std;

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

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

#include<iostream>
using namespase std;

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

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespase'
    2 | using namespase std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string S;
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:8:6: error: 'S' was not declared in this scope
    8 |   if(S.at(i)=="+"){
      |      ^
a.cc:15:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |   cout<<N<<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:12: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |   cout<<N<<endl;
      |            ^~~~
      |            std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
using namespease std;

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

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespease'
    2 | using namespease std;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string S;
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:8:6: error: 'S' was not declared in this scope
    8 |   if(S.at(i)=="+"){
      |      ^
a.cc:15:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |   cout<<N<<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:12: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |   cout<<N<<endl;
      |            ^~~~
      |            std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
using namespeas std;

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

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespeas'
    2 | using namespeas std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string S;
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:8:6: error: 'S' was not declared in this scope
    8 |   if(S.at(i)=="+"){
      |      ^
a.cc:15:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |   cout<<N<<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:12: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |   cout<<N<<endl;
      |            ^~~~
      |            std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<isotream>
using namespeas std;

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

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

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

using ll    = long long;
using ull   = unsigned long long;
using veci  = vector<int>;
using vecll = vector<ll>;
#define EPS (1e-7)
#define INF (1e9)
#define PI  (acos(-1))
#define FOR(i,a,b) for(int i = (a);i < (b); ++i)
#define REP(i,n) for(int i= 0;i<(int)(n);++i)
#define pb push_back

veci enum_div(int n){
	veci ret;
	ret.pb(1);
	for(int i=1;i*i<n;i++){
		if(n%i==0){
			ret.pb(i);
			if(i != n/i){ret.pb(n/i);}
		}
	}
	ret.pb(n);
	return ret;
}
int gcb(int a,int b){return ((b == 0)? a : gcb(b,a%b));}
int gcd(int a,int b){return (a*b) / gcb(a,b);}

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



Compiler output:
a.cc: In function 'int main()':
a.cc:35:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   35 |         if(s[i] == "+"){
a.cc:38:18: error: expected ';' before ':' token
   38 |             ans--:
      |                  ^
      |                  ;
Language: C++

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

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

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    1 | #inlcude <bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:1: error: 'string' was not declared in this scope
    6 | string s;
      | ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | #inlcude <bits/stdc++.h>
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin>>s;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inlcude <bits/stdc++.h>
a.cc:7:8: error: 's' was not declared in this scope
    7 |   cin>>s;
      |        ^
a.cc:16:3: error: 'cout' was not declared in this scope
   16 |   cout<<p<<endl;
      |   ^~~~
a.cc:16:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:12: error: 'endl' was not declared in this scope
   16 |   cout<<p<<endl;
      |            ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inlcude <bits/stdc++.h>
Language: C++

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
#include<functional>
#include<vector>
#include<map>

using namespace std;
#define endl '\n'
#define pb push_back
#define fst first
#define scd second
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define REP(i,n) for(int i = 0;i < (n);i++)
#define FOR(i,a,b) for(int i = (a);i <= (b);i++)
#define YES(n) cout << ((n) ? "YES" : "NO" ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl

constexpr int MOD = 1000000007;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<vector<int>> vii;

template <class T = int> T in() { T x; cin >> x; return (x); }
template <class T = int> void out(T x) { cout << (x) << endl; }

int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }

void solve() {

	string S;

	cin >> S;
	int ans = 0;
	REP(i, S.size()) {
		if (s[i] == '+') ans++;
		else ans--;
	}

	out(ans);

	return;

}

int main() {

	cin.tie(0);
	ios::sync_with_stdio(false);

	solve();

	return 0;

}

Compiler output:
a.cc: In function 'void solve()':
a.cc:47:21: error: 's' was not declared in this scope
   47 |                 if (s[i] == '+') ans++;
      |                     ^
Language: C++

#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int ans = 0;
  string s;

  cin >> s;

  for(int i = 0;i < 4;i++){
    if(s[i] == '-'){
      ans --;
    }else{
      ans ++;
  }

  cout << ans << endl;
  return 0;
}


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

#include <iostream>
#include <string>

using namespace	std;

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


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

#include <stdio.h>
int main(){
  char s[4];
  int i,j=0;
  scanf("%s",s);
  for(i=0;1<4;i++) s[i]-'-'?j++:j--;
  printf("%d"j);
}

Compiler output:
main.c: In function 'main':
main.c:7:14: error: expected ')' before 'j'
    7 |   printf("%d"j);
      |         ~    ^
      |              )
Language: Java

import java.util.*;

public class main {
  public static void main(String args[]) {
      Scanner sc = new Scanner(System.in);
      String s = sc.nextLine();
      int ans = 0;
      for(int i = 0; i < 4; i++) {
          String next = String.valueOf(s.charAt(i));
          if(next == "+") {
               i++;
          } else if(next == "-") {
               i--;
         }
      }
      System.out.println(ans);
  }
}


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

import java.util.*;

public class main {
  public static void main(String args[]) {
      Scanner sc = new Scanner(System.in);
      String s = sc.nextLine();
      int ans = 0;
      for(int i = 0; i < 4; i++) {
          char next = s.charAt(i);
          if(String.valueOf(next).equal("+")) {
               i++;
          } else if(String.valueOf(next).equal("-")) {
               i--;
         }
      }
      System.out.println(ans);
  }
}


Compiler output:
Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
       ^
Main.java:10: error: cannot find symbol
          if(String.valueOf(next).equal("+")) {
                                 ^
  symbol:   method equal(String)
  location: class String
Main.java:12: error: cannot find symbol
          } else if(String.valueOf(next).equal("-")) {
                                        ^
  symbol:   method equal(String)
  location: class String
3 errors
Language: Java

import java.util.*;

public class main {
  public static void main(String args[]) {
      Scanner sc = new Scanner(System.in);
      String s = sc.nextLine();
      int ans = 0;
      for(int i = 0; i < 4; i++) {
          char next = s.charAt(i);
          if(next.equal("+")) {
               i++;
          } else if(next.equal("-")) {
               i--;
         }
      }
      System.out.println(ans);
  }
}


Compiler output:
Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
       ^
Main.java:10: error: char cannot be dereferenced
          if(next.equal("+")) {
                 ^
Main.java:12: error: char cannot be dereferenced
          } else if(next.equal("-")) {
                        ^
3 errors
Language: Java

import java.util.*;

public class main {
  public static void main(String args[]) {
      Scanner sc = new Scanner(System.in);
      String s = sc.nextLine();
      int ans = 0;
      for(int i = 0; i < 4; i++) {
          Charactor next = s.charAt(i);
          if(next.equal("+")) {
               i++;
          } else if(next.equal("-")) {
               i--;
         }
      }
      System.out.println(ans);
  }
}


Compiler output:
Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
       ^
Main.java:9: error: cannot find symbol
          Charactor next = s.charAt(i);
          ^
  symbol:   class Charactor
  location: class main
2 errors
Language: Java

import java.util.*;

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


Compiler output:
Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
       ^
Main.java:9: error: incompatible types: char cannot be converted to String
          String next = s.charAt(i);
                                ^
2 errors
Language: Java

import java.util.*;

public class main {
  public static void main(String args[]) {
      Scanner sc = new Scanner(System.in);
      String s = sc.nextLine();
      int ans = 0;
      for(int i = 0; i < 4; i++) {
          String next = s.charAt(i);
          if(next == "+") {
               i++;
          } elseif(next == "-") {
               i--;
         }
      }
      System.out.println(ans);
  }
}

Compiler output:
Main.java:12: error: ';' expected
          } elseif(next == "-") {
                               ^
1 error
Language: C++

import java.util.*;

public class main {
  public static void main(String args[]) {
      Scanner sc = new Scanner(System.in);
      String s = sc.nextLine();
      int ans = 0;
      for(int i = 0; i < 4; i++) {
          String next = s.charAt(i);
          if(next == "+") {
               i++;
          } elseif(next == "-") {
               i--;
         }
      }
      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:3:1: error: expected unqualified-id before 'public'
    3 | public class main {
      | ^~~~~~
Language: C++

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

	return 0;
}

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

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

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: 's' was not declared in this scope
    9 |                 if(s[i]=='+')ans++;
      |                    ^
a.cc:10:23: error: no 'operator--(int)' declared for postfix '--' [-fpermissive]
   10 |                 else n--;
      |                      ~^~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: 'N' was not declared in this scope
    8 |   for ( int i = 0; i < N; i++) {
      |                        ^
a.cc:9:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     if ( S.at(i) == "+" ) number++;
      |          ~~~~~~~~^~~~~~
Language: C++

#include<stdio.h>
char s[4];
int t=0;
int main(){
	scanf("%a",&s);
  	for(int k=0;k<4;k++){
    	if(s[k]=="+")t++;
    	else if(s[k]=="-")t--;
    }
  	printtf("%d",t);
  	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |         if(s[k]=="+")t++;
      |            ~~~~^~~~~
a.cc:8:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |         else if(s[k]=="-")t--;
      |                 ~~~~^~~~~
a.cc:10:9: error: 'printtf' was not declared in this scope; did you mean 'printf'?
   10 |         printtf("%d",t);
      |         ^~~~~~~
      |         printf
Language: C++

#include<stdio.h>
char s;
int t=0;
int main(){
	scanf("%a",&s);
  	for(int k=0;k<4;k++){
    	if(s[k]=="+")t++;
    	else if(s[k]=="-")t--;
    }
  	printtf("%d",t);
  	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: invalid types 'char[int]' for array subscript
    7 |         if(s[k]=="+")t++;
      |             ^
a.cc:8:18: error: invalid types 'char[int]' for array subscript
    8 |         else if(s[k]=="-")t--;
      |                  ^
a.cc:10:9: error: 'printtf' was not declared in this scope; did you mean 'printf'?
   10 |         printtf("%d",t);
      |         ^~~~~~~
      |         printf
Language: C++

#include<stdio.h>
#include<string.h>
string s;
int t=0;
int main(){
	scanf("%c",&s);
  	for(int k=0;k<4;k++){
    	if(s[k]=="+")t++;
    	else if(s[k]=="-")t--;
    }
  	printtf("%d",t);
  	return 0;
}


Compiler output:
a.cc:3:1: error: 'string' does not name a type; did you mean 'stdin'?
    3 | string s;
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:6:21: error: 's' was not declared in this scope
    6 |         scanf("%c",&s);
      |                     ^
a.cc:11:9: error: 'printtf' was not declared in this scope; did you mean 'printf'?
   11 |         printtf("%d",t);
      |         ^~~~~~~
      |         printf
Language: C++

#include<stdio.h>
string s;
int t=0;
int main(){
	scanf("%c",&s);
  	for(int k=0;k<4;k++){
    	if(s[k]=="+")t++;
    	else if(s[k]=="-")t--;
    }
  	printtf("%d",t);
  	return 0;
}


Compiler output:
a.cc:2:1: error: 'string' does not name a type; did you mean 'stdin'?
    2 | string s;
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:5:21: error: 's' was not declared in this scope
    5 |         scanf("%c",&s);
      |                     ^
a.cc:10:9: error: 'printtf' was not declared in this scope; did you mean 'printf'?
   10 |         printtf("%d",t);
      |         ^~~~~~~
      |         printf
Language: C++

#include<stdio.h>
string s;
int t=0;
int main(){
	scanf("%c",&s);
  	for(int k=0;k<4;k++){
    	if(s[k]==+)t++;
    	else if(s[k]==-)t--;
    }
  	printtf("%d",t);
  	return 0;
}


Compiler output:
a.cc:2:1: error: 'string' does not name a type; did you mean 'stdin'?
    2 | string s;
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:5:21: error: 's' was not declared in this scope
    5 |         scanf("%c",&s);
      |                     ^
a.cc:7:19: error: expected primary-expression before ')' token
    7 |         if(s[k]==+)t++;
      |                   ^
a.cc:8:24: error: expected primary-expression before ')' token
    8 |         else if(s[k]==-)t--;
      |                        ^
a.cc:10:9: error: 'printtf' was not declared in this scope; did you mean 'printf'?
   10 |         printtf("%d",t);
      |         ^~~~~~~
      |         printf
Language: C++

#include<stdio.h>
char s[4];
int t=0;
int main(){
	scanf("%s",&s);
  	for(int k=0;k<4;k++){
    	if(s[k]==+)t++;
    	else if(s[k]==-)t--;
    }
  	printtf("%d",t);
  	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: expected primary-expression before ')' token
    7 |         if(s[k]==+)t++;
      |                   ^
a.cc:8:24: error: expected primary-expression before ')' token
    8 |         else if(s[k]==-)t--;
      |                        ^
a.cc:10:9: error: 'printtf' was not declared in this scope; did you mean 'printf'?
   10 |         printtf("%d",t);
      |         ^~~~~~~
      |         printf
Language: C++

#include<stdio.h>
char s;
int t=0;
int main(){
	scanf("%s",&s);
  	for(int k=0;k<4;k++){
    	if(s[k]==+)t++;
    	else if(s[k]==-)t--;
    }
  	printtf("%d",t);
  	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: invalid types 'char[int]' for array subscript
    7 |         if(s[k]==+)t++;
      |             ^
a.cc:7:19: error: expected primary-expression before ')' token
    7 |         if(s[k]==+)t++;
      |                   ^
a.cc:8:18: error: invalid types 'char[int]' for array subscript
    8 |         else if(s[k]==-)t--;
      |                  ^
a.cc:8:24: error: expected primary-expression before ')' token
    8 |         else if(s[k]==-)t--;
      |                        ^
a.cc:10:9: error: 'printtf' was not declared in this scope; did you mean 'printf'?
   10 |         printtf("%d",t);
      |         ^~~~~~~
      |         printf
Language: C++

#include<stdio.h>
char s;
int t=0;
int main(){
	scanf("%s",&s);
  	for(int k=0:k<4;k++){
    	if(s[k]==+)t++;
    	else if(s[k]==-)t--;
    }
  	printtf("%d",t);
  	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: initializer in range-based 'for' loop
    6 |         for(int k=0:k<4;k++){
      |                  ^
a.cc:6:24: error: expected ')' before ';' token
    6 |         for(int k=0:k<4;k++){
      |            ~           ^
      |                        )
a.cc:6:25: error: 'k' was not declared in this scope
    6 |         for(int k=0:k<4;k++){
      |                         ^
a.cc:10:9: error: 'printtf' was not declared in this scope; did you mean 'printf'?
   10 |         printtf("%d",t);
      |         ^~~~~~~
      |         printf
Language: C++

#include<stdio.h>
char s;
int t=0;
int main (){
	scanf("%s",&s);
  	for(int k=0:k<4;k++){
    if(s[k]==+)t++;
    else if(s[k]==-)t--;
    }
  	printtf("%d",t);
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: initializer in range-based 'for' loop
    6 |         for(int k=0:k<4;k++){
      |                  ^
a.cc:6:24: error: expected ')' before ';' token
    6 |         for(int k=0:k<4;k++){
      |            ~           ^
      |                        )
a.cc:6:25: error: 'k' was not declared in this scope
    6 |         for(int k=0:k<4;k++){
      |                         ^
a.cc:10:9: error: 'printtf' was not declared in this scope; did you mean 'printf'?
   10 |         printtf("%d",t);
      |         ^~~~~~~
      |         printf
Language: C++

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

int main() {
  string S;
  cin >> S;
  
  for(int i=0; i < S.size(); i++){
    cout << char[i] <<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: expected primary-expression before 'char'
    9 |     cout << char[i] <<endl;
      |             ^~~~
Language: C++

#include <iostream>
#include <iostream>

using namespace std;

int main(){
  string S,drip;int sum = 0;
  for (int i  = 0;i < 4;i++){
    drip = S.substr(i,1)
    if (drip == '-'){
      sum -= 1;
    }else{
      sum += 1;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:25: error: expected ';' before 'if'
    9 |     drip = S.substr(i,1)
      |                         ^
      |                         ;
   10 |     if (drip == '-'){
      |     ~~                   
a.cc:12:6: error: 'else' without a previous 'if'
   12 |     }else{
      |      ^~~~
Language: C++

#include <iostream>
#include <iostream>

using namespace std;

int main(){
  char drip;
  string S;int sum = 0;
  for (int i  = 0;i < 4;i++){
    drip = S.substr(i,1)
    if (drip == '-'){
      sum -= 1;
    }else{
      sum += 1;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: cannot convert 'std::__cxx11::basic_string<char>' to 'char' in assignment
   10 |     drip = S.substr(i,1)
      |            ~~~~~~~~^~~~~
      |                    |
      |                    std::__cxx11::basic_string<char>
a.cc:13:6: error: 'else' without a previous 'if'
   13 |     }else{
      |      ^~~~
Language: C++

#include <iostream>
#include <iostream>

using namespace std;

int main(){
  string S;int drip,sum = 0;
  for (int i  = 0;i < 4;i++){
    drip = S.substr(i,1)
    if (drip == '-'){
      sum -= 1;
    }else{
      sum += 1;
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: cannot convert 'std::__cxx11::basic_string<char>' to 'int' in assignment
    9 |     drip = S.substr(i,1)
      |            ~~~~~~~~^~~~~
      |                    |
      |                    std::__cxx11::basic_string<char>
a.cc:12:6: error: 'else' without a previous 'if'
   12 |     }else{
      |      ^~~~
Language: C++

#include <iostream>
#include <iostream>

using namespace std;

int main(){
  string S;int sum = 0
  for (int i  = 0;i < 4;i++){
    if (S.substr(i,1) == '-'){
      sum -= 1;
    }else{
      sum += 1;
    }
  }
}


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++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:6: error: expected '}' at end of input
   16 |     }
      |      ^
a.cc:8:40: note: to match this '{'
    8 |   for (int i = 0; i < str.size(); i++) {
      |                                        ^
a.cc:16:6: error: expected '}' at end of input
   16 |     }
      |      ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C

#include<stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:7:20: error: expected ';' before ')' token
    7 |     for(i=0,i<4;i++){
      |                    ^
      |                    ;
Language: C++

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


Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:16: error: expected primary-expression before ';' token
    8 |   for (int i = ; i < 4;i++){
      |                ^
Language: C

#include <stdio.h>
 
int main(){
  
  long N;
  scanf("%ld %ld",&N,&K);
  int i;
  long A[N];
  for(i = 0; i < N; i++){
    scanf("%ld",&A[i]);
  }
  
  long ans = N / (K - 1);
  printf("%ld",ans);
 
  return 0;
  
}
#include <stdio.h>
 
int main(){
  
  long N,K;
  scanf("%ld %ld",&N,&K);
  int i;
  long A[N];
  for(i = 0; i < N; i++){
    scanf("%ld",&A[i]);
  }
  
  long ans = N / (K - 1);
  printf("%ld",ans);
 
  return 0;
  
}
提出情報

Compiler output:
main.c: In function 'main':
main.c:6:23: error: 'K' undeclared (first use in this function)
    6 |   scanf("%ld %ld",&N,&K);
      |                       ^
main.c:6:23: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:21:5: error: redefinition of 'main'
   21 | int main(){
      |     ^~~~
main.c:3:5: note: previous definition of 'main' with type 'int()'
    3 | int main(){
      |     ^~~~
main.c:37:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
   37 | 提出情報
      | ^~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <numeric>

int main() {
    std::string S;
    std::cin >> S;

    long plus = std::count(S.begin(), S.end(), '+');
    long minus = std::count(S.begin(), S.end(), '-');
    std::cout << plus - minus << std::endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: 'count' is not a member of 'std'; did you mean 'cout'?
    9 |     long plus = std::count(S.begin(), S.end(), '+');
      |                      ^~~~~
      |                      cout
a.cc:10:23: error: 'count' is not a member of 'std'; did you mean 'cout'?
   10 |     long minus = std::count(S.begin(), S.end(), '-');
      |                       ^~~~~
      |                       cout
Language: C++

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

Compiler output:
a.cc:17:1: error: 'm' does not name a type; did you mean 'tm'?
   17 | m
      | ^
      | tm
Language: C++

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

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

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

#Include<stdio.h>

int main (void){
 int ans;
 int S[];
  scanf("%d",&ans);
  for(int i;i<=3;i++){
    
    if(S[i]==+) ans++;
    else if(S[i]==-) ans--;
  }

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

Compiler output:
main.c:1:2: error: invalid preprocessing directive #Include; did you mean #include?
    1 | #Include<stdio.h>
      |  ^~~~~~~
      |  include
main.c: In function 'main':
main.c:5:6: error: array size missing in 'S'
    5 |  int S[];
      |      ^
main.c:6:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    6 |   scanf("%d",&ans);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #Include<stdio.h>
main.c:6:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    6 |   scanf("%d",&ans);
      |   ^~~~~
main.c:6:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:9:15: error: expected expression before ')' token
    9 |     if(S[i]==+) ans++;
      |               ^
main.c:13:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   13 | printf ("\n%d\n",ans);
      | ^~~~~~
main.c:13:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:13:1: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

fn main() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();

    let mut ans = 0;
    for i in s.trim().chars() {
        if i == '+' {
            ans += 1;
        } else {
            ans -= 1;
        }
    }

    println!("{}", ans);
}


Compiler output:
a.cc:1:1: error: 'fn' does not name a type
    1 | fn main() {
      | ^~
Language: C++

    #include <stdio.h>
     
    int main()
    {
    	char s[4];
    	scanf("%s", s);
    	switch (s) {
    	    case ----:
    	        printf("-4\n");
    	        break;
    	    case ---+:
    	    case --+-:
    	    case -+--:
          	case +---:
          printf("-2\n");
    	        break;
    	    case ++--:
    	    case +-+-:
    	    case +--+:
    	    case --++:
    	    case -+-+:
    	    case -++-:
          printf("0\n");
    	        break;
    	    case +++-:
    	    case ++-+:
    	    case +-++:
          	case -+++:
          printf("2\n");
    	        break;
          	case ++++:
          printf("4\n");
    	}
    	return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: switch quantity not an integer
    7 |         switch (s) {
      |                 ^
a.cc:8:22: error: expected primary-expression before ':' token
    8 |             case ----:
      |                      ^
a.cc:11:22: error: expected primary-expression before ':' token
   11 |             case ---+:
      |                      ^
a.cc:12:22: error: expected primary-expression before ':' token
   12 |             case --+-:
      |                      ^
a.cc:13:22: error: expected primary-expression before ':' token
   13 |             case -+--:
      |                      ^
a.cc:14:26: error: expected primary-expression before ':' token
   14 |                 case +---:
      |                          ^
a.cc:17:22: error: expected primary-expression before ':' token
   17 |             case ++--:
      |                      ^
a.cc:18:22: error: expected primary-expression before ':' token
   18 |             case +-+-:
      |                      ^
a.cc:19:22: error: expected primary-expression before ':' token
   19 |             case +--+:
      |                      ^
a.cc:20:22: error: expected primary-expression before ':' token
   20 |             case --++:
      |                      ^
a.cc:21:22: error: expected primary-expression before ':' token
   21 |             case -+-+:
      |                      ^
a.cc:22:22: error: expected primary-expression before ':' token
   22 |             case -++-:
      |                      ^
a.cc:25:22: error: expected primary-expression before ':' token
   25 |             case +++-:
      |                      ^
a.cc:26:22: error: expected primary-expression before ':' token
   26 |             case ++-+:
      |                      ^
a.cc:27:22: error: expected primary-expression before ':' token
   27 |             case +-++:
      |                      ^
a.cc:28:26: error: expected primary-expression before ':' token
   28 |                 case -+++:
      |                          ^
a.cc:31:26: error: expected primary-expression before ':' token
   31 |                 case ++++:
      |                          ^
Language: C++

#include <stdio.h>

int main()
{
	char s[4];
	scanf("%s, s);
	switch (s) {
	    case ----:
	        printf("-4\n");
	        break;
	    case ---+:
	    case --+-:
	    case -+--:
      	case +---:
      printf("-2\n");
	        break;
	    case ++--:
	    case +-+-:
	    case +--+:
	    case --++:
	    case -+-+:
	    case -++-:
      printf("0\n");
	        break;
	    case +++-:
	    case ++-+:
	    case +-++:
      	case -+++:
      printf("2\n");
	        break;
      	case ++++:
      printf("4\n");
	}
	return 0;
}

Compiler output:
a.cc:6:15: warning: missing terminating " character
    6 |         scanf("%s, s);
      |               ^
a.cc:6:15: error: missing terminating " character
    6 |         scanf("%s, s);
      |               ^~~~~~~~
a.cc: In function 'int main()':
a.cc:7:9: error: expected primary-expression before 'switch'
    7 |         switch (s) {
      |         ^~~~~~
Language: C++

package main

import "fmt"

// 2018-07-30T21:14:16+0800
// 2018-07-30T21:16:27+0800
func main() {
	var s string
	fmt.Scanf("%s", &s)
	n := 0
	for i := 0; i < len(s); i++ {
		if s[i] == '+' {
			n++
		} else if s[i] == '-' {
			n--
		}
	}
	fmt.Println(n)
}

Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
Language: C++

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

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

#include <stdio.h>
#include <iostream>

int main() {
	string s;
  std::cin >> s;
int cur = 0;  
  for(auto itr : s){
	if(itr == '+') cur++;
    else cur--;
  }
  
  std::cout << cur << endl;
 return 0; 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'string' was not declared in this scope
    5 |         string s;
      |         ^~~~~~
a.cc:5:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:6:15: error: 's' was not declared in this scope
    6 |   std::cin >> s;
      |               ^
a.cc:13:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 |   std::cout << cur << endl;
      |                       ^~~~
      |                       std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <stdio.h>
#include <iostream>

int main() {
	string s;
  std::cin >> s;
int cur = 0;  
  for(auto itr : s){
	if(itr == '+') cur++;
    else cur--;
  }
  
  cout << cur << endl;
 return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'string' was not declared in this scope
    5 |         string s;
      |         ^~~~~~
a.cc:5:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:6:15: error: 's' was not declared in this scope
    6 |   std::cin >> s;
      |               ^
a.cc:13:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |   cout << cur << 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:13:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 |   cout << cur << endl;
      |                  ^~~~
      |                  std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C

#include <cstdio>

int main() {
  char S[4];
  scanf("%s", S);

  int A = 0;

  for(int i = 0 < 4, i++) {
     if(S[i] == '+'){
       A++;
     }else
       A--;
  }
  printf("%d\n", A);
  return 0;
}


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

#include <stdio.h>

int main() {
  char S[4];
  scanf("%s", S);

  int A = 0;

  for(int i = 0 < 4, i++) {
     if(S[i] == '+'){
       A++;
     }else
       A--;
  }
  printf("%d\n", A);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    9 |   for(int i = 0 < 4, i++) {
      |                       ^~
main.c:16:3: error: expected expression before 'return'
   16 |   return 0;
      |   ^~~~~~
main.c:17:1: error: expected expression before '}' token
   17 | }
      | ^
Language: C

#include<string>
#include <stdio.h>

int main() {
  char S[4];
  scanf("%s", S);

  int A = 0;

  for(int i = 0 < 4, i++) {
     if(S[i] == '+'){
       A++;
     }else
       A--;
  }
  printf("%d\n", A);
  return 0;
}


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

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

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

#import<ios>
int t;main(char s){for(;~scanf("%c",&s);)s==43?t++:t--;printf("%d",++t);}

Compiler output:
main.c:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import<ios>
      |  ^~~~~~
main.c:1:8: fatal error: ios: No such file or directory
    1 | #import<ios>
      |        ^~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main(){

    char x[4];

    int ans = 0;

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

         cin >> x[a];

         if(x[a] == '+') ans++;

         else ans--;

     cout << ans << endl;

     return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:2: error: expected '}' at end of input
   22 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^