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

#include <stdio.h>
 
         
        int main(void){
            int  i = 0;
            int num = 0;
           char buf[4];
           scanf("%s", &buf[]);
           
           while(i <= 3){
            switch(buf[i]){
                case '+': num = num+1; break;
                case '-': num = num-1; break;
            }
            i++;
           }
           printf("%d\n", num);
           return 0;
        } 

Compiler output:
main.c: In function 'main':
main.c:8:29: error: expected expression before ']' token
    8 |            scanf("%s", &buf[]);
      |                             ^
Language: C

#include <stdio.h>
 
         
        int main(void){
            int  i = 0;
           char buf[];
           scanf("%s", &buf);
           
           while(i <= 3){
            switch(buf[i]){
                case '+': num = num+1; break;
                case '-': num = num-1; break;
            }
            i++;
           }
           printf("%d\n", num);
           return 0;
        } 

Compiler output:
main.c: In function 'main':
main.c:6:17: error: array size missing in 'buf'
    6 |            char buf[];
      |                 ^~~
main.c:11:27: error: 'num' undeclared (first use in this function)
   11 |                 case '+': num = num+1; break;
      |                           ^~~
main.c:11:27: note: each undeclared identifier is reported only once for each function it appears in
Language: Java

import java.util.Scanner;

public class c101_1 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char s[] = new char[4];
		String S = sc.nextLine();
		int num = 0;
		for(int i=0;i<4;i++) {
			s[i] = S.charAt(i);
			if(s[i] == '+')num++;
			else if(s[i] == '-')num--;
		}
		System.out.print(num);
	}
}

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

#include <stdio.h>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: 'a' was not declared in this scope
    8 |         scanf("%c", &a[i]);
      |                      ^
Language: C++

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

int main(){
	int i = 0;
	string a;
	string b;
	stirng c;
	string d;

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

		if(a = '+'){
			i += 1;
		} else {
			i -= 1;
		}

		if(b = '+'){
			i += 1;
		} else {
			i -= 1;
		}

		if(c = '+'){
			i += 1;
		} else {
			i -= 1;
		}

		if(d = '+'){
			i += 1;
		} else {
			i -= 1;
		}

	printf("%d\n", i);

}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'string' was not declared in this scope; did you mean 'stdin'?
    6 |         string a;
      |         ^~~~~~
      |         stdin
a.cc:7:15: error: expected ';' before 'b'
    7 |         string b;
      |               ^~
      |               ;
a.cc:8:9: error: 'stirng' was not declared in this scope
    8 |         stirng c;
      |         ^~~~~~
a.cc:9:15: error: expected ';' before 'd'
    9 |         string d;
      |               ^~
      |               ;
a.cc:11:22: error: 'a' was not declared in this scope
   11 |         scanf("&s", &a);
      |                      ^
a.cc:12:22: error: 'b' was not declared in this scope
   12 |         scanf("&s", &b);
      |                      ^
a.cc:13:22: error: 'c' was not declared in this scope
   13 |         scanf("&s", &c);
      |                      ^
a.cc:14:22: error: 'd' was not declared in this scope
   14 |         scanf("&s", &d);
      |                      ^
Language: C

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

int main(void){
  int i = 0;
  int result = 0;
  char str[8];

  sacanf("%s", str);
  for(int b=0; b<4; b++){
    if(str[b]=="+"){
      i++;
    }else{
      i--;
    }
  }
  printf("%d",i);
  return ;
}


Compiler output:
main.c: In function 'main':
main.c:9:3: error: implicit declaration of function 'sacanf'; did you mean 'sscanf'? [-Wimplicit-function-declaration]
    9 |   sacanf("%s", str);
      |   ^~~~~~
      |   sscanf
main.c:11:14: warning: comparison between pointer and integer
   11 |     if(str[b]=="+"){
      |              ^~
main.c:18:3: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
   18 |   return ;
      |   ^~~~~~
main.c:4:5: note: declared here
    4 | int main(void){
      |     ^~~~
Language: C

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

int main(void){
  int i = 0;
  int result = 0;
  char S = str[8];

  sacanf("%s", str);
  for(int b=0; b<4; b++){
    if(str[b]=="+"){
      i++
    }else{
      i--;
    }
  }
  printf("%d",i);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:12: error: 'str' undeclared (first use in this function)
    7 |   char S = str[8];
      |            ^~~
main.c:7:12: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:3: error: implicit declaration of function 'sacanf'; did you mean 'sscanf'? [-Wimplicit-function-declaration]
    9 |   sacanf("%s", str);
      |   ^~~~~~
      |   sscanf
main.c:12:10: error: expected ';' before '}' token
   12 |       i++
      |          ^
      |          ;
   13 |     }else{
      |     ~
Language: C

#include <stdio.h>

int main(void){
   char num1, num2, num3, num4;
   printf("S : ")
   scanf("%d%d%d%d", &num1, &num2, &num3, &num4);
  int first = 0;
  if(num1 == +){
     first++
  }else{
     first--
  }
  if(num2 == +){
     first++
  }else{
     first--
  }
  if(num3 == +){
     first++
  }else{
     first--
  }
  if(num4 == +){
     first++
  }else{
     first--
  }
  printf("first:%d, first);
}

Compiler output:
main.c: In function 'main':
main.c:5:18: error: expected ';' before 'scanf'
    5 |    printf("S : ")
      |                  ^
      |                  ;
    6 |    scanf("%d%d%d%d", &num1, &num2, &num3, &num4);
      |    ~~~~~          
main.c:8:15: error: expected expression before ')' token
    8 |   if(num1 == +){
      |               ^
main.c:11:13: error: expected ';' before '}' token
   11 |      first--
      |             ^
      |             ;
   12 |   }
      |   ~          
main.c:13:15: error: expected expression before ')' token
   13 |   if(num2 == +){
      |               ^
main.c:16:13: error: expected ';' before '}' token
   16 |      first--
      |             ^
      |             ;
   17 |   }
      |   ~          
main.c:18:15: error: expected expression before ')' token
   18 |   if(num3 == +){
      |               ^
main.c:21:13: error: expected ';' before '}' token
   21 |      first--
      |             ^
      |             ;
   22 |   }
      |   ~          
main.c:23:15: error: expected expression before ')' token
   23 |   if(num4 == +){
      |               ^
main.c:26:13: error: expected ';' before '}' token
   26 |      first--
      |             ^
      |             ;
   27 |   }
      |   ~          
main.c:28:10: warning: missing terminating " character
   28 |   printf("first:%d, first);
      |          ^
main.c:28:10: error: missing terminating " character
   28 |   printf("first:%d, first);
      |          ^~~~~~~~~~~~~~~~~~
main.c:29:1: error: expected expression before '}' token
   29 | }
      | ^
main.c:28:10: error: expected ';' before '}' token
   28 |   printf("first:%d, first);
      |          ^
      |          ;
   29 | }
      | ~
Language: C

 #include<stdio.h>
     
    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;
    }nclude <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:
main.c:15:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   15 |     }nclude <cstdio>
      |             ^
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:
main.c:1:14: fatal error: cstdio: No such file or directory
    1 |     #include <cstdio>
      |              ^~~~~~~~
compilation terminated.
Language: C++

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

int N = 0;
char op;
for(int i = 0; i < 4; i++){
  cin >> op;
  if(op == '+'){
  	N++;	
  }
  else if(op == '-'){
  	N--;
  }
  cout << N << endl;
}

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

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: expected ';' before '}' token
   14 |             count--
      |                    ^
      |                    ;
   15 |         }
      |         ~
Language: C++

#include <iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
char a[100000];
int main()
{
cin>>a;
int n=0;
for(int i=0;i<t;i++)
{
    if(a[i]=='+')
        n++;
    if(a[i]=='-')
        n--;
}
cout<<n<<endl;
    return 0;
}


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

#include <iostream>
#include<stdio.h>
#include<string.h>
using namespace std;
char a[100000];
int main()
{
gets(a);
int t=strlen(a);
int n=0;
for(int i=0;i<t;i++)
{
    if(a[i]=='+')
        n++;
    if(a[i]=='-')
        n--;
}
cout<<n<<endl;
    return 0;
}


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

#include <iostream>
#include <string>
#include <cstring>
#include <iomanip>
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <map>
#include <queue>
#include <vector>
#include <set>
#include <stack>
using namespace std;
#define ll long long
#define maxn 200005
#define angel 0x3f3f3f3f
#define eps 1e-9
#define my_angel main
#define ull unsigned long long
char str[30];
int my_angel()
{
    scanf("%s",str+1);
    int sum=0;
    for(int i=1;i<=4;i++)
    {
        if(str[i]=='+')
            sum++;
        else
            sum--;
    }
    printf("%d\n",ans);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
   33 |     printf("%d\n",ans);
      |                   ^~~
      |                   abs
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        String S = in.next();
        int ans = 0;
        for(int i=0;i<4;i++){
            char cur = S.charAt();
            if(cur=='+') ans += 1;
            else ans-= 1;
        }
        System.out.println(ans);
    }
}

Compiler output:
Main.java:11: error: method charAt in class String cannot be applied to given types;
            char cur = S.charAt();
                        ^
  required: int
  found:    no arguments
  reason: actual and formal argument lists differ in length
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int ans=0;
    char s[5];
    gets(s);

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


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

#include<bits/stdc++.h>
using namespace std;
int main(){
    int ans=0;
    char s[5];
    gets(s);

    for(int i=0;i<4;i++){
        switch(s[i]){
            case'+':
                ans++;
            case'-':
                ans--;
        }
    }

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


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

#include<stdio.h>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: conflicting declaration 'char s [5]'
    6 |         char s[5];
      |              ^
a.cc:5:18: note: previous declaration as 'int s [5]'
    5 |         int n=0, s[5];
      |                  ^
a.cc:8:14: error: 'i' was not declared in this scope
    8 |         for (i = 0; i < 5; i++){
      |              ^
Language: C++


a = 0
s = input()
n = len(S)

for i in range(0,n):
    if s[i] == "+":
        a = a+1
    if s[i] == "-":
        a = a-1
        
print(a)

Compiler output:
a.cc:2:1: error: 'a' does not name a type
    2 | a = 0
      | ^
Language: C++

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

int n = 0;
char str[3]; 

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

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

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

int n = 0;
char str[3]; 

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: expected ';' before ')' token
   10 |   for(i=0,i<4,++i){
      |                  ^
      |                  ;
a.cc:15:3: error: expected primary-expression before 'return'
   15 |   return 0;
      |   ^~~~~~
a.cc:14:19: error: expected ')' before 'return'
   14 |   cout<< n <<endl;
      |                   ^
      |                   )
   15 |   return 0;
      |   ~~~~~~           
a.cc:10:6: note: to match this '('
   10 |   for(i=0,i<4,++i){
      |      ^
Language: C++

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

int n = 0;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'str' was not declared in this scope; did you mean 'std'?
    8 |   cin>> str >>endl;
      |         ^~~
      |         std
a.cc:9:18: error: expected ';' before ')' token
    9 |   for(i=0,i<4,++i){
      |                  ^
      |                  ;
a.cc:14:3: error: expected primary-expression before 'return'
   14 |   return 0;
      |   ^~~~~~
a.cc:13:19: error: expected ')' before 'return'
   13 |   cout<< n <<endl;
      |                   ^
      |                   )
   14 |   return 0;
      |   ~~~~~~           
a.cc:9:6: note: to match this '('
    9 |   for(i=0,i<4,++i){
      |      ^
Language: C++

#include<iostream>
using namespace std;
int main(){
   int ans = 0;
   string S;
   cin >> S;

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


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

#include<iostream>
using namespace std;
int main(){
   int ans = 0;
   string S;
   cin >> S;

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

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

#include<iostream>
using namespace std;
int main(){
   int ans = 0;
   string S
   cin >> S

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:4: error: expected initializer before 'cin'
    6 |    cin >> S
      |    ^~~
a.cc:8:16: error: 'i' was not declared in this scope
    8 |    for(int i=0;i<4;i++){
      |                ^
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:4: error: expected initializer before 'cin'
    6 |    cin >> S[5]
      |    ^~~
a.cc:7:16: error: 'i' was not declared in this scope
    7 |    for(int i=1;i<=4;i++){
      |                ^
a.cc:16:2: error: expected '}' at end of input
   16 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

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

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

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String[] sArr = sc.next().split("");

        int num = 0;
        for(int i = 0; i < sArr.length; i++){
            if(sArr[i].equals("+")){
                num++;
            }
            else{
                num--;
            }
        }
        System.out.println(num);
        
    }
}


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>
using namespace std;

string s;

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

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

#include<iostream>
using namespace tsd;
int main(){
     string s;
     int sum=0;
     cin>>s;
     for(int i=0;i<s.size();i++){
          if(s[i]=='+'){
               sum++;
          }
     }
     cout<<2*sum-s.size();
     return 0;
}

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

#include<iostream>
using namespace tsd;
int main(){
     string s;
     cin>>s;
     for(int i=0;i<s.size();i++){
          if(s[i]=='+'){
               sum++;

     return 0;
}

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

#include <iostream>
#include <>

using namespace std;

int main()
{
    int num =0;
   	 for(int i = 0;i<4;i++)
     {
       std::string tep;
       cin>> tep;
       if(tep=="+")
       {
         num++;
       }
       else{
        num--;
       }
       
     }
     
    cout<<num;
  
  return 0;
  
  
}

Compiler output:
a.cc:2:10: error: empty filename in #include
    2 | #include <>
      |          ^~
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner;
    String s = sc.next();
    int count = 0;
    
    for(int j = 0; j < 4; j++){
      if(s.charAt(j) == '+')
        count++;
      else
        count--;
    }
    System.out.println(count);
  }
}

Compiler output:
Main.java:4: error: '(' or '[' expected
    Scanner sc = new Scanner;
                            ^
1 error
Language: C++

#include<iostream>
#include<string>

using namespace std;

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

  cin >> S;

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

  cout << result << endl;

	return 0;
}

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

#include <bits/stdc++.h>

using namespace sd;
using ll = long long;

int main(){
  string S;
  cin >> S;
  ll k{0};
  for (char c: S){
    if (c == '-'){
      k--;
    } else {
      k++;
    }
  }
  cout << k;
}

Compiler output:
a.cc:3:17: error: 'sd' is not a namespace-name
    3 | using namespace sd;
      |                 ^~
a.cc: In function 'int main()':
a.cc:7:3: error: 'string' was not declared in this scope
    7 |   string S;
      |   ^~~~~~
a.cc:7:3: 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:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   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:8:10: error: 'S' was not declared in this scope
    8 |   cin >> S;
      |          ^
a.cc:17:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 |   cout << k;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

import java.util.*;

public class Main {
  public static void main(String[] args) throws Exception {
    Scanner sc = new Scanner(System.in);
    String line = sc.nextLine();
    int score = 0;
    for ( char sign : line.toCharArray() ) {
      if ( sign == '+' ) {
        score++;
      } else if ( sign == '-' ) {
        score--;
      }
    }
    System.out.println(score);
  }
}

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<queue>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
double s(LL n)
{
    long long x=n;
    long long y=0;
    while(x!=0)
    {
        y+=x%10;
        x=x/10;
    }
    return n/y;
}
int main()
{
    long long K;
    long long n=1;
    long long x=1;
    scanf("%d",&K);
    for (int i=0;i<K;i++)
    {
        printf("%d\n",n);
        if (s(n+x)>s(n+x*10))
            x=x*10;
        n+=x;
    }
    return 0;
}

Compiler output:
a.cc:7:10: error: 'LL' was not declared in this scope
    7 | double s(LL n)
      |          ^~
a.cc: In function 'int main()':
a.cc:27:14: error: 's' cannot be used as a function
   27 |         if (s(n+x)>s(n+x*10))
      |             ~^~~~~
a.cc:27:21: error: 's' cannot be used as a function
   27 |         if (s(n+x)>s(n+x*10))
      |                    ~^~~~~~~~
Language: C++

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


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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: request for member 'compare' in 's.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
    8 |         if(s[i].compare("+")) {
      |                 ^~~~~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: expected initializer before 'cin'
    6 |     cin >> s;
      |     ^~~
a.cc:7:29: error: 's' was not declared in this scope
    7 |     for(int i = 0; i < (int)s.size(); ++i){
      |                             ^
Language: C++

#include <iostream>

using namespace std;
int main(){
  int sum = 0;
  string str;
  cin >> str;
  for (int i=0; i < str.length(); i++){
    if (str.at(i) == '+') sum++;
    else sum--;
  }
  cout << sum << endl;
  return;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: return-statement with no value, in function returning 'int' [-fpermissive]
   13 |   return;
      |   ^~~~~~
Language: C++

#include <iostream>

namespace std;
int main(){
  int sum = 0;
  string str;
  cin >> str;
  for (i=0; i < str.len(); i++){
    if (str.at(i) == '+') sum++;
    else sum--;
  }
  cout << sum << endl;
  return;
}

Compiler output:
a.cc:3:14: error: expected '{' before ';' token
    3 | namespace std;
      |              ^
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string str;
      |   ^~~~~~
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:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> str;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:10: error: 'str' was not declared in this scope; did you mean 'std'?
    7 |   cin >> str;
      |          ^~~
      |          std
a.cc:8:8: error: 'i' was not declared in this scope
    8 |   for (i=0; i < str.len(); i++){
      |        ^
a.cc:12:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |   cout << sum << 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:12:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 |   cout << sum << endl;
      |                  ^~~~
      |                  std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:13:3: error: return-statement with no value, in function returning 'int' [-fpermissive]
   13 |   return;
      |   ^~~~~~
Language: C++

#include <iostream>

int main(){
  int sum = 0;
  string str;
  cin >> str;
  for (i=0; i < str.len(); i++){
    if (str.at(i) == '+') sum++;
    else sum--;
  }
  cout << sum << endl;
  return;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
    5 |   string str;
      |   ^~~~~~
a.cc:5: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:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> str;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:10: error: 'str' was not declared in this scope; did you mean 'std'?
    6 |   cin >> str;
      |          ^~~
      |          std
a.cc:7:8: error: 'i' was not declared in this scope
    7 |   for (i=0; i < str.len(); i++){
      |        ^
a.cc:11:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |   cout << sum << 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:11:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 |   cout << sum << endl;
      |                  ^~~~
      |                  std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:12:3: error: return-statement with no value, in function returning 'int' [-fpermissive]
   12 |   return;
      |   ^~~~~~
Language: C++

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


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

  int n = 0;

  for(int i=0; i<size(s); i++){
    if(s[i] == '+'){
      n += 1;
    }else{
      n -= 1;
    }
  }

  cout << n << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: error: no matching function for call to 'size(int&)'
   16 |   for(int i=0; i<size(s); i++){
      |                  ~~~~^~~
In file included from /usr/include/c++/14/string:53,
                 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:4:
/usr/include/c++/14/bits/range_access.h:262:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/range_access.h: In substitution of 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&) [with _Container = int]':
a.cc:16:22:   required from here
   16 |   for(int i=0; i<size(s); i++){
      |                  ~~~~^~~
/usr/include/c++/14/bits/range_access.h:263:24: error: request for member 'size' in '__cont', which is of non-class type 'const int'
  263 |     -> decltype(__cont.size())
      |                 ~~~~~~~^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note:   template argument deduction/substitution failed:
a.cc:16:22: note:   mismatched types 'const _Tp [_Nm]' and 'int'
   16 |   for(int i=0; i<size(s); i++){
      |                  ~~~~^~~
a.cc:17:9: error: invalid types 'int[int]' for array subscript
   17 |     if(s[i] == '+'){
      |         ^
Language: C++

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


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

  int n = 0;

  for(i=0; i<size(s); i++){
    if(s[i] == '+'){
      n += 1;
    }else{
      n -= 1;
    }
  }

  cout << n << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:7: error: 'i' was not declared in this scope
   16 |   for(i=0; i<size(s); i++){
      |       ^
a.cc:16:18: error: no matching function for call to 'size(int&)'
   16 |   for(i=0; i<size(s); i++){
      |              ~~~~^~~
In file included from /usr/include/c++/14/string:53,
                 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:4:
/usr/include/c++/14/bits/range_access.h:262:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/range_access.h: In substitution of 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&) [with _Container = int]':
a.cc:16:18:   required from here
   16 |   for(i=0; i<size(s); i++){
      |              ~~~~^~~
/usr/include/c++/14/bits/range_access.h:263:24: error: request for member 'size' in '__cont', which is of non-class type 'const int'
  263 |     -> decltype(__cont.size())
      |                 ~~~~~~~^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note:   template argument deduction/substitution failed:
a.cc:16:18: note:   mismatched types 'const _Tp [_Nm]' and 'int'
   16 |   for(i=0; i<size(s); i++){
      |              ~~~~^~~
Language: C++


#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <complex>

#define forin(i, f, t) for(auto i = f; i < t; i++)

using namespace std;
using ll = long long;


int main() {
    string s;
    cin >> s;
    
    int counter = 0;
    for (auto c : s) {
        counter += c == '+' ? 1 + -1;
    }
    cout << counter << endl;
    
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:20:37: error: expected ':' before ';' token
   20 |         counter += c == '+' ? 1 + -1;
      |                                     ^
      |                                     :
a.cc:20:37: error: expected primary-expression before ';' token
Language: C++

#include <stdio.h>

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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'else' without a previous 'if'
   13 |   } else {
      |     ^~~~
Language: C++

#include <stdio.h>

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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'else' without a previous 'if'
   13 |   } else if {
      |     ^~~~
a.cc:13:13: error: expected '(' before '{' token
   13 |   } else if {
      |             ^
      |             (
Language: C++

#include <stdio.h>

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


Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: expected '(' before '{' token
   12 |   } else if {
      |             ^
      |             (
a.cc:16:2: error: expected '}' at end of input
   16 | }
      |  ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

#include <stdio.h>

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: expected ';' before 'for'
    8 |   scanf("%s", S)
      |                 ^
      |                 ;
    9 |   for(i=0;i < 4;i++){
      |   ~~~            
a.cc:9:20: error: expected ';' before ')' token
    9 |   for(i=0;i < 4;i++){
      |                    ^
      |                    ;
a.cc:16:2: error: expected '}' at end of input
   16 | }
      |  ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: Java

package test3;

import java.util.Scanner;

public class Tset3_1 {

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

		Scanner scan = new Scanner(System.in);

		S = scan.next();
		
		for(int i=0;i< S.length();i++) {
			String str=S.substring(i, i+1);
			if(str.equals("+")) {
				Count++;
			}else if(str.equals("-")){
				Count--;
			}else {
				
			}
		}
		System.out.println(Count);
	}

}

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

package test3;

import java.util.Scanner;

public class Tset3_1 {

	public  void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		String S = "";
		int Count = 0;

		Scanner scan = new Scanner(System.in);

		S = scan.next();
		
		for(int i=0;i< S.length();i++) {
			String str=S.substring(i, i+1);
			if(str.equals("+")) {
				Count++;
			}else if(str.equals("-")){
				Count--;
			}else {
				
			}
		}
		System.out.println(Count);
	}

}

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

import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int first = 0;
        String eats;
        for (int i = 0; i < 4; i++){
            eats = scan.next();
            if (eats.equals("+")){
                first++;
            }else if(eats.equals("-")) {
                first--;
            }
        }
        scan.close();
        System.out.println(first);
    }
}

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

import java.util.Scanner;

public class test {
    public static void main(String[] args){
        int score = 0;
        Scanner scanner = new Scanner(System.in);

        String first_line = scanner.nextLine();
        for(int i = 0; i <=3; i++){
            char input = first_line.charAt(i);
            if(input=='+'){
                score++;
            }else{
                score--;
            }
        }
        scanner.close();

        System.out.println(score);
    }

}


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

#include <stdio.h>

int main(void)
{
   int n,k,a[100000],ans,i;

   scanf("%d%d",&n,&k);

   for(i=0;i<n;i++)
      scanf("%d",&a[i]);

   n--; k--;
   if((n/k)%=0) ans=n/k;
   else         ans=n-k+1;

   printf("%d\n",ans);

   return 0;
}


Compiler output:
main.c: In function 'main':
main.c:13:12: error: lvalue required as left operand of assignment
   13 |    if((n/k)%=0) ans=n/k;
      |            ^~
Language: C++

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

int main(void)
{
 char n[100];
 int s,i,x,num;

 scanf("%s", n);
 x=strlen(n);
 num=atoi(n);
 s=0;
 for(i=0;i<x;i++){
  s=s+(n[i]-'0');
  }
 if((num%s)==0) printf("Yes\n");
 else if((num%s)!=0) printf("No\n");

 return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:11:6: error: 'atoi' was not declared in this scope
   11 |  num=atoi(n);
      |      ^~~~
Language: C

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

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

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

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

S=input()
str_list=list(S)
count=0
c_count=0
for st in str_list:
    if st=="+":
        count+=1
    else:
        c_count+=1
print(count-c_count)

Compiler output:
a.cc:1:1: error: 'S' does not name a type
    1 | S=input()
      | ^
Language: C++

#include<iostream>
using naemspace std;
int main(){
int N;
cin>>N;
int a[N];
for(int i = 0;i < N;i++) cin>>a[i];
for(int i = 0;i < N;i++) cout<<1;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'naemspace'
    2 | using naemspace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 | cin>>N;
      | ^~~
      | std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:26: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 | for(int i = 0;i < N;i++) cout<<1;
      |                          ^~~~
      |                          std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

l = input().strip()
ans=0
for i in range(len(l)):
    if l[i] == '+':
        ans +=1
    elif l[i] == '-':
        ans -=1
print(ans)


Compiler output:
a.cc:1:1: error: 'l' does not name a type
    1 | l = input().strip()
      | ^