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

#include <bits/stdc++.h>

using namespace std;

int main() {
	string s; cin >> s;
	while (auto &c: s) {
		x += (c - '0');
	}
	cout << x << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: found ':' in nested-name-specifier, expected '::'
    7 |         while (auto &c: s) {
      |                       ^
      |                       ::
a.cc:7:22: error: 'c' has not been declared
    7 |         while (auto &c: s) {
      |                      ^
a.cc:7:26: error: qualified-id in declaration before ')' token
    7 |         while (auto &c: s) {
      |                          ^
a.cc:8:17: error: 'x' was not declared in this scope
    8 |                 x += (c - '0');
      |                 ^
a.cc:8:23: error: 'c' was not declared in this scope
    8 |                 x += (c - '0');
      |                       ^
a.cc:10:17: error: 'x' was not declared in this scope
   10 |         cout << x << endl;
      |                 ^
Language: C++


#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
using namespace std;
typedef long long ll;
typedef struct pair<int,int> P;
typedef struct pair<int,P> P2;

ll d[1001]={};
int a[100001]={};
int main() {
	char chr;
	int i=0;
	for(int i=0;i<3;++i){
		cin>>chr;
		if(chr=="1")i++;
	}
	cout<<i<<endl;
	return 0;
}


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

#include<bits/stdc++.h>

int main(){
  int a,b,c;
  cin >> a >> b >> c;
  
  cout << a << b << c << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin >> a >> b >> c;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |   cout << a << b << c << 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:7:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |   cout << a << b << c << endl;
      |                          ^~~~
      |                          std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<bits/stdc++.h>

int main(){
  char a[1],b[1],c[1];
  cin >> a >> b >> c;
  
  cout << a << b << c << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin >> a >> b >> c;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |   cout << a << b << c << 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:7:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |   cout << a << b << c << endl;
      |                          ^~~~
      |                          std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: Java

Import java.util.*;

public class Main {
	 public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		int ans = 0;
		for (int i = 0; i < str.length(); i++) {
			String st = str.substring(i,i+1);
			if (st.equals(“1”)) {
				ans++;
			
		}
	}
} 

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
Import java.util.*;
^
Main.java:10: error: illegal character: '\u201c'
			if (st.equals(?1?)) {
			              ^
Main.java:10: error: illegal character: '\u201d'
			if (st.equals(?1?)) {
			                ^
Main.java:15: error: reached end of file while parsing
} 
 ^
4 errors
Language: Java

Import java.util.*;

public class Main {
	 public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		int ans = 0;
		for (int i = 0; i < str.length(); i++) {
			String st = str.substring(i,i+1);
			if (st.equals(“1”)) {
				ans++;
			}
		}
	}
} 

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
Import java.util.*;
^
Main.java:10: error: illegal character: '\u201c'
			if (st.equals(?1?)) {
			              ^
Main.java:10: error: illegal character: '\u201d'
			if (st.equals(?1?)) {
			                ^
3 errors
Language: Java


public int answerA(int a, int b, int c) {
    int result = 0;
    if (a == 1) {
        result++;
    }
    if (b == 1) {
        result++;
    }
    if (c == 1) {
        result++;
    }
}

Compiler output:
Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
public int answerA(int a, int b, int c) {
       ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: C



#include <stdio.h.


int main()
{
	int count = 0;
	int i;
	int m;
	int n[199];
	scanf("%d", &i);

	for (m = 0; m <= i; m++)
	{
		scanf("%d", &n[m]);
	}
	for (m = 0; m <= i; m++)
	{
		if (n[m] % 2 == 1) 
		{
			break;
		}

			n[m] = n[m] / 2;
		
			count++;
		
	
		
}
	
	printf("%d", count);

    return 0;
}



Compiler output:
main.c:3:19: error: missing terminating > character
    3 | #include <stdio.h.
      |                   ^
main.c:3:10: fatal error: stdio.h.: No such file or directory
    3 | #include <stdio.h.
      |          ^
compilation terminated.
Language: C

define<stdio.h>
int main()
{
	int count=0;
	int i;
	int m;
	int n[199];
	scanf("%d", &i);
	
	for (m = 0; m <= i; m++)
	{
		scanf("%d", &n[m]);
	}
	for (m = 0; m <= i; m++)
	{
		while( n[m] % 2 == 0) {
			count++;
		}
break;
	}
	printf("%d", count);

    return 0;
}


Compiler output:
main.c:1:7: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | define<stdio.h>
      |       ^
Language: C++

#include<stdio.h>
int main(void)
{
	int n;
	int i;
	int count;
	int number[100] = { 0 };
	int old_number[100] = { 0 };
	scanf_s("%d", &n);
	for (i = 0; i < n; i++)
	{
		scanf_s("%d", &number[i]);
		old_number[i] = number[i];
	}
	for (count = 0;; count++)
	{
		for (i = 0; i < n; i++)
		{
			number[i] /= 2;
			if (2 * number[i] != old_number[i])
			{
				goto label;
			}
			old_number[i] = number[i];
		}
	}
label:
	printf("%d", count);
}

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

#include<stdio.h>
int main(void)
{
	int n;
	int i;
	int count;
	int number[100] = { 0 };
	int old_number[100]{ 0 };
	scanf_s("%d", &n);
	for (i = 0; i < n; i++)
	{
		scanf_s("%d", &number[i]);
		old_number[i] = number[i];
	}
	for (count = 0;; count++)
	{
		for (i = 0; i < n; i++)
		{
			number[i] /= 2;
			if (2 * number[i] != old_number[i])
			{
				goto label;
			}
			old_number[i] = number[i];
		}
	}
label:
	printf("%d", count);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    9 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: Java

public class Main {

	public static void main(String[] args) {
		Main solution = new Main();
		Scanner sca = new Scanner(System.in);
		int ans = 0;
		String str = sca.next();
		ans = solution.oneCount(str);
		System.out.println(ans);
		sca.close();
	}
	
	public int oneCount(String string) {
		int res = 0;
		for (int i = 0; i < string.length(); i++) {
			String s = string.substring(i, i+1);
			if (s.equals("1")) {
				res++;
			}
		}
		return res;
	}

}


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

# -*- coding: utf-8 -*-
# 整数の入力
a = int(raw_input())
# スペース区切りの整数の入力
b, c = map(int, raw_input().split())
# 文字列の入力
s = raw_input()
# 出力
print str(a+b+c) + " " + s


Compiler output:
a.cc:1:3: error: invalid preprocessing directive #-
    1 | # -*- coding: utf-8 -*-
      |   ^
a.cc:2:3: error: invalid preprocessing directive #\U00006574\U00006570\U0000306e\U00005165\U0000529b
    2 | # 整数の入力
      |   ^~~~~~~~~~
a.cc:4:3: error: invalid preprocessing directive #\U000030b9\U000030da\U000030fc\U000030b9\U0000533a\U00005207\U0000308a\U0000306e\U00006574\U00006570\U0000306e\U00005165\U0000529b
    4 | # スペース区切りの整数の入力
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:6:3: error: invalid preprocessing directive #\U00006587\U00005b57\U00005217\U0000306e\U00005165\U0000529b
    6 | # 文字列の入力
      |   ^~~~~~~~~~~~
a.cc:8:3: error: invalid preprocessing directive #\U000051fa\U0000529b
    8 | # 出力
      |   ^~~~
a.cc:3:1: error: 'a' does not name a type
    3 | a = int(raw_input())
      | ^
Language: C++

# 整数の入力
a = int(raw_input())
# スペース区切りの整数の入力
b, c = map(int, raw_input().split())
# 文字列の入力
s = raw_input()
# 出力
print str(a+b+c) + " " + s


Compiler output:
a.cc:1:3: error: invalid preprocessing directive #\U00006574\U00006570\U0000306e\U00005165\U0000529b
    1 | # 整数の入力
      |   ^~~~~~~~~~
a.cc:3:3: error: invalid preprocessing directive #\U000030b9\U000030da\U000030fc\U000030b9\U0000533a\U00005207\U0000308a\U0000306e\U00006574\U00006570\U0000306e\U00005165\U0000529b
    3 | # スペース区切りの整数の入力
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:5:3: error: invalid preprocessing directive #\U00006587\U00005b57\U00005217\U0000306e\U00005165\U0000529b
    5 | # 文字列の入力
      |   ^~~~~~~~~~~~
a.cc:7:3: error: invalid preprocessing directive #\U000051fa\U0000529b
    7 | # 出力
      |   ^~~~
a.cc:2:1: error: 'a' does not name a type
    2 | a = int(raw_input())
      | ^
Language: C++

#include<stdio.h>
#include<algorithm>

int main() {
	int n, k, a[200000] = { 0 }, ans = 0;
	scanf("%d %d", &n, &k);
	for (int i = 0; i < n; ++i) {
		int x;
		scanf("%d", &x);
		++a[x];
	}
	int norma = 0;
	for (auto&& x : a) {
		if (x > 0) ++norma;
	}
	norma -= k;
	std::sort(std::begin(a), std::end(a), [](int x, int y){return x < y; });
	for (int i = 0; norma > 0; ++i) {
		if (a[i] > 0) {
			--norma;
			ans += a[i];
		}
	}
	printf("%d", ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:29: error: no matching function for call to 'begin(int [200000])'
   17 |         std::sort(std::begin(a), std::end(a), [](int x, int y){return x < y; });
      |                   ~~~~~~~~~~^~~
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
                 from /usr/include/c++/14/bits/stl_algo.h:59,
                 from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/initializer_list:88:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)'
   88 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
/usr/include/c++/14/initializer_list:88:5: note:   template argument deduction/substitution failed:
a.cc:17:29: note:   mismatched types 'std::initializer_list<_Tp>' and 'int*'
   17 |         std::sort(std::begin(a), std::end(a), [](int x, int y){return x < y; });
      |                   ~~~~~~~~~~^~~
a.cc:17:42: error: no matching function for call to 'end(int [200000])'
   17 |         std::sort(std::begin(a), std::end(a), [](int x, int y){return x < y; });
      |                                  ~~~~~~~~^~~
/usr/include/c++/14/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
/usr/include/c++/14/initializer_list:99:5: note:   template argument deduction/substitution failed:
a.cc:17:42: note:   mismatched types 'std::initializer_list<_Tp>' and 'int*'
   17 |         std::sort(std::begin(a), std::end(a), [](int x, int y){return x < y; });
      |                                  ~~~~~~~~^~~
Language: C

#include<stdio.h>
int main(void){
int s;

scanf("%d",&s);
if(s==000){
printf("0\n");}
else if(s==111){
printf("3\n");}
else if(s==100){
printf("1\n");}
else if(s==001){
printf("1\n");}
else if(s==010){
printf("1\n");}
}else
printf("2\n");



return 0;
}


Compiler output:
main.c:16:2: error: expected identifier or '(' before 'else'
   16 | }else
      |  ^~~~
main.c:21:1: error: expected identifier or '(' before 'return'
   21 | return 0;
      | ^~~~~~
main.c:22:1: error: expected identifier or '(' before '}' token
   22 | }
      | ^
Language: Java

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

public class Main {
    public static void main(String[] args) throws IOException {
        FastScanner in = new FastScanner();
        /*int s = in.nextInt();
        String S = Integer.toString(s);*/
        String S = in.nextToken();
        int count = 0;
        
        for (int i = 0; i < 3; i++)
        {
            char digit = S.charAt(i);
            if (digit == '1')) //'x' char, "x" string.  Use == for primitive types (char, int, double, long, etc) and .equals() for others (String, ArrayList, etc)
            {
             count ++;   
            }
                      
        
        }
        System.out.println(count);
    }

    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String nextToken() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            return null;
        }

        int nextInt() {
            return Integer.parseInt(nextToken());
        }

        long nextLong() {
            return Long.parseLong(nextToken());
        }

        double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }
}


Compiler output:
Main.java:15: error: illegal start of expression
            if (digit == '1')) //'x' char, "x" string.  Use == for primitive types (char, int, double, long, etc) and .equals() for others (String, ArrayList, etc)
                             ^
1 error
Language: C

#include<stdio.h>

int main()
{
	int i, n,count = 0;

	for (i = 0; i < 3; i++)
	{
		scanf("%d", &n);
		if (n == 1)
			count++;
	}

	printf("%d", coun);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:22: error: 'coun' undeclared (first use in this function); did you mean 'count'?
   14 |         printf("%d", coun);
      |                      ^~~~
      |                      count
main.c:14:22: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main(void){
 int N,i,j=0,k=0,A[N];
 scanf("%d",&N);
 for(i=0;i<N;i++){
  scanf("%d",&A[i]);
 }
 while(1){
 for(i=0;i<N;i++){
  if(A[i]%2==1) j++;
 }
 if(j>0) break;
 for(i=0;i<N;i++){
 A[i]=A[i]/2;
 k++;
 }
 printf("%d",k);
 return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:1: error: expected declaration or statement at end of input
   19 | }
      | ^
Language: C

g namespace std;
 
int main(){
    
    //cout << "文字列を入力：";
    int sum = 0;
    int s;
    cin >> s;
    if(s == 001||s==010||s==100){
    	sum++;
    } else if (s==011||s==101||s==110){
       sum = sum+2;
    } else if  (s==111) {
        sum = sum+3;
    } else if  (s==000){
    	sum = 0;
    }
    cout << sum << endl;
    return 0;
}

Compiler output:
main.c:1:1: error: unknown type name 'g'
    1 | g namespace std;
      | ^
main.c:1:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    1 | g namespace std;
      |             ^~~
main.c: In function 'main':
main.c:8:5: error: 'cin' undeclared (first use in this function)
    8 |     cin >> s;
      |     ^~~
main.c:8:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:5: error: 'cout' undeclared (first use in this function)
   18 |     cout << sum << endl;
      |     ^~~~
main.c:18:20: error: 'endl' undeclared (first use in this function)
   18 |     cout << sum << endl;
      |                    ^~~~
Language: C++

#include <iostream>
#include <string>

int main()
{
	string s;
	std::cin >> s;
	int n = 0;
	for (int i = 0; i < 3; i++)
	{
		n += s[i] - '0';
	}
	std::cout << n << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'string' was not declared in this scope
    6 |         string s;
      |         ^~~~~~
a.cc:6:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:21: error: 's' was not declared in this scope
    7 |         std::cin >> s;
      |                     ^
Language: C++

#include<stdio.h>
int main()
{
  int s,i,s[3];
  int ans=0;
      scanf("%d",&s);
  for(i=0;i<3;i++)
    {
      s[i]=s%10;
      if(s[i])
	{
	  ans++;
	}
      s=s/10;
    }
  printf("%d",ans);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:11: error: conflicting declaration 'int s [3]'
    4 |   int s,i,s[3];
      |           ^
a.cc:4:7: note: previous declaration as 'int s'
    4 |   int s,i,s[3];
      |       ^
a.cc:9:8: error: invalid types 'int[int]' for array subscript
    9 |       s[i]=s%10;
      |        ^
a.cc:10:11: error: invalid types 'int[int]' for array subscript
   10 |       if(s[i])
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
string str1;
int ans=0;
cin>>str1;
for(int i=1;i<=3;i++){
if(str[i-1]=='1')ans++;
}
cout<<ans;
return 0;
}

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

#include <stdio.h>

int main()
{   int char a[2],i,count = 0;
	scanf("%s",a);
	for (i = 0;i <3;i++){
	if(a[i] == 1)count ++;
	}
	
	printf("%d  \n",count);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:4:9: error: two or more data types in declaration specifiers
    4 | {   int char a[2],i,count = 0;
      |         ^~~~
Language: C

#include <stdio.h>

int main()
{   int char a[2],i,count = 0;
	for (i = 0;i <3;i++){
	scanf("%s",a);
	if(a[i] == 1)count ++;
	}
	
	printf("%d  \n",count);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:4:9: error: two or more data types in declaration specifiers
    4 | {   int char a[2],i,count = 0;
      |         ^~~~
Language: C++

#include <stdio.h>

int main()
{   int char a[2],i,count = 0;
	for (i = 0;i <3;i++){
	scanf("%s",a);
	if(a[i] == 1)count ++;
	}
	
	printf("%d  \n",count);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: two or more data types in declaration of 'a'
    4 | {   int char a[2],i,count = 0;
      |     ^~~
a.cc:4:5: error: two or more data types in declaration of 'i'
a.cc:4:5: error: two or more data types in declaration of 'count'
a.cc:5:14: error: 'i' was not declared in this scope
    5 |         for (i = 0;i <3;i++){
      |              ^
a.cc:6:20: error: 'a' was not declared in this scope
    6 |         scanf("%s",a);
      |                    ^
a.cc:7:22: error: 'count' was not declared in this scope
    7 |         if(a[i] == 1)count ++;
      |                      ^~~~~
a.cc:10:25: error: 'count' was not declared in this scope
   10 |         printf("%d  \n",count);
      |                         ^~~~~
Language: Java

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 < 3; i++){
            if(s.charAt(i) == '1') ans++;
        }
        System.out.println(ans);
    }
}


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

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

int main()
{
   char s,i,k=0,c='1';
   cin>>s;
   for(i=0;i<=2;i++)
    if(s[i]==c)
        k++;
   cout<<k;
   return 0;
}

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

#include<stdio.h>
int main()
{
	char a[5];
	int i,s=0;
	gets(a);
	for(i=0;i<3;i++)
	{
		if(a[i]=='1')
		{
			s++;
		}
	}
	printf("%d\n",s);
	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(a);
      |         ^~~~
      |         getw
Language: C

 #include<stdio.h>
    int main()
    {
    int n,i,j=0,k;
    scanf("%d %d ",&n,&k);
    int a[20000]={0};
    for(i=0;i<n;i++)
    {
    scanf("%d ",&x);
    a[x]++;
    }
    for(i=0;i<n;i++)
    {if(a[i]!=0)
    j++;}
    printf("%d",(j-k));
    }

Compiler output:
main.c: In function 'main':
main.c:9:18: error: 'x' undeclared (first use in this function)
    9 |     scanf("%d ",&x);
      |                  ^
main.c:9:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main()
{
int n,i;
scanf("%d",&n);
if(n==1 || n==10 || n==100 )
printf("1");
if (n==11 || n==101 || n==110)
printf("2");
if (n==111)
printf("3");
return0;
}

Compiler output:
main.c: In function 'main':
main.c:12:1: error: 'return0' undeclared (first use in this function)
   12 | return0;
      | ^~~~~~~
main.c:12:1: note: each undeclared identifier is reported only once for each function it appears in
Language: C

 #include<stdio.h>
    int main()
    {
    int n,i,j=0,k;
    scanf("%d %d ",&n,&k);
    int a[200]={0};
    for(i=0;i<n;i++)
    {
    scanf("%d ",&x);
    a[x]++;
    }
    for(i=0;i<n;i++)
    {if(a[i]!=0)
    j++;}
    printf("%d",(j-k));
    }

Compiler output:
main.c: In function 'main':
main.c:9:18: error: 'x' undeclared (first use in this function)
    9 |     scanf("%d ",&x);
      |                  ^
main.c:9:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
using namespace std;
int main()
{
	char s[5];
	scanf("%s", s);
	int len = strlen(s);
	int count = 0;
	for (int i = 0; i < len; i++) {
		if (s[i] == '1') {
			count++;
		}
	}
	printf("%d", count);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: 'strlen' was not declared in this scope
    7 |         int len = strlen(s);
      |                   ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include<stdio.h>
int main()
{
	char s[4];
	while(gets(s)!=NULL)
	{
		int c=0;
		if(s[0]!='0') c++;
		if(s[1]!='0') c++;
		if(s[2]!='0') c++;
		printf("%d\n",c);
	}
}

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

#include <iostream>
using namespace std;

int main() {
	int X, Y, Z;
	cin >> X, Y, Z;

	if (X = 1, Y = 1, Z = 1) {
		cout << "3" << endl;
	}
	else if (X=1<Y=1|Y=1,Z=1|X=1,Z=1) {
		cout << "2" << endl;
	}
	else if (X = 1|Y=1|Z=1){
		cout << "1" << endl;
	}
	else{
		cout << "0" << endl;
	} 

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: lvalue required as left operand of assignment
   11 |         else if (X=1<Y=1|Y=1,Z=1|X=1,Z=1) {
      |                        ~^~
a.cc:11:33: error: lvalue required as left operand of assignment
   11 |         else if (X=1<Y=1|Y=1,Z=1|X=1,Z=1) {
      |                                ~^~
a.cc:14:27: error: lvalue required as left operand of assignment
   14 |         else if (X = 1|Y=1|Z=1){
      |                          ~^~
Language: C

#include<stdio.h>
int main()
{
int n,i,j=0,k;
scanf("%d %d",&n,&k);
int a[n+1]={0};
for(i=0;i<n;i++)
{
scanf("%d",&x);
a[x]++;
}
for(i=0;i<n;i++)
{if(a[i]!=0)
j++;}
printf("%d",(j-k));
}

Compiler output:
main.c: In function 'main':
main.c:6:12: error: variable-sized object may not be initialized except with an empty initializer
    6 | int a[n+1]={0};
      |            ^
main.c:9:13: error: 'x' undeclared (first use in this function)
    9 | scanf("%d",&x);
      |             ^
main.c:9:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C

# include <stdio.h>

int hp2(int n){
  int p=0;  
  while(n%2==0){
    n/=2;
    c++;
  }
  return c;
}
int main()
{
  int a, max=0, n;
  scanf("%d", &n);
  for(int i=0; i<n; i++) {
    scanf("%d", &a);
    b=hp2(a);
    if(max<b)
       max= b;
   }
   return 0;
}

Compiler output:
main.c: In function 'hp2':
main.c:7:5: error: 'c' undeclared (first use in this function)
    7 |     c++;
      |     ^
main.c:7:5: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:17:5: error: 'b' undeclared (first use in this function)
   17 |     b=hp2(a);
      |     ^
Language: C

#include <stdio.h>
 
int main(void)
{	int n,i;
	int endcount = 0;
	int count = 0;
	scanf("%d\n",&n);
	int a[n];
	for(i = 0;i < n;i++){
	scanf("%d\n",&a[i]);
	if(a[i] % 2 == 1 ||a[i] == 0)
		endcount += 1;
	}
	if(endcount > 0){
	printf("0/n");
	}
	else{
	do{
		for(i = 0;i < n;i++){
			if(a[i] % 2 == 1){
				endcount += 1;
			}
			a[i] = a[i] / 2;
			}
	count += 1;		
	}while(endcount == 0);
	printf("%d\n",count - 1);
}
return 0;
}

Compiler output:
main.c:2:1: error: stray '\302' in program
    2 | <U+00A0>
      | ^~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
int X,count;
count=0;
cin>>X;
 
  if( X%10==1)
   count++;
X/=10;
if( X%10==1)
   count++;
 X/=10;
   if( X==1)
   count++;
cout<<count;
return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:18:10: error: expected '}' at end of input
   18 | return 0;
      |          ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

#include <stdio.h>
int main (void)
{
    char s;
    while(scanf("%s",s)!=EOF)
    {
        int count = 0;
        for(int i=0;i<=2;i++)
            if(s[i]=='1')
                count++;
        printf("%d\n",count);
    }
    return 0;
}


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

#include<stdio.h>
{
int main()
{
int i,j=0;
scanf("%d",&i);
while(i>0)
{
j=j+i%10;
i=i/10;
}
printf("%d",j);
}


Compiler output:
main.c:2:1: error: expected identifier or '(' before '{' token
    2 | {
      | ^
Language: C++

#include<bits/stdc++.h>
int main()
{
int X,count,i;
count=0;
for( i =0; i<3; i++)
{
  cin>>X;
   if( X==1)
   count++;
}
cout<<count;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   cin>>X;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:12:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 | cout<<count;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C

# include <stdio.h>
# include <ctype.h>
int main()
{
    int c=0, s;
    while( isdigit(s=getchar()))
        c+= (s-'0');
    printf("%d", c);
    return 0;
}
~   

Compiler output:
main.c:11:1: error: expected identifier or '(' before '~' token
   11 | ~
      | ^
Language: C

# include <stdio.h>
int main()
{
    int c=0, s;
    while( isdigit(s=getchar()))
        c+= (s-'0');
    printf("%d", c);
    return 0;
}
~   

Compiler output:
main.c: In function 'main':
main.c:5:12: error: implicit declaration of function 'isdigit' [-Wimplicit-function-declaration]
    5 |     while( isdigit(s=getchar()))
      |            ^~~~~~~
main.c:2:1: note: include '<ctype.h>' or provide a declaration of 'isdigit'
    1 | # include <stdio.h>
  +++ |+#include <ctype.h>
    2 | int main()
main.c: At top level:
main.c:10:1: error: expected identifier or '(' before '~' token
   10 | ~
      | ^
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(void){
    string  s;
    cin >> s;
    cout << atoi(s[0]) + atoi(s[1]) + atoi(s[2]);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
    7 |     cout << atoi(s[0]) + atoi(s[1]) + atoi(s[2]);
      |             ~~~~^~~~~~
      |                 |
      |                 __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:7:30: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
    7 |     cout << atoi(s[0]) + atoi(s[1]) + atoi(s[2]);
      |                          ~~~~^~~~~~
      |                              |
      |                              __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:7:43: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
    7 |     cout << atoi(s[0]) + atoi(s[1]) + atoi(s[2]);
      |                                       ~~~~^~~~~~
      |                                           |
      |                                           __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C

#include<stdio>
int main()
{
char a[3];
scanf("%s", a);
int count=0;
int i;
for(i=0;i<3;i++)
if(a[i]=='1')
count++;
printf("%d", count);
return 0;
}

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

#include <iostream>
#include <string>
using namespace std;
int main(void){
    string  s;
    cin >> s;
    cout << ctoi(s[0]) + ctoi(s[1]) + ctoi(s[2]);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: 'ctoi' was not declared in this scope; did you mean 'atoi'?
    7 |     cout << ctoi(s[0]) + ctoi(s[1]) + ctoi(s[2]);
      |             ^~~~
      |             atoi
Language: C++

#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	char a[3];
	int sum=0;
        gets(a);
     for(int i=0;i<3;i++){
    	if(a[i]=='1')
    		sum++;
	}
		printf("%d\n",sum);
}

	

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

include <iostream>
using namespace std;
int main(){
int N;
cin>>N;
int A[N];
for(int i=0;i<N;i++){
cin>>A[i];
}
int j=0;
int m=100;
for(int k=0; k<N; k++){
j=0;
	for(int l=0; A[k]%2==0; l++){
	j++
	A[k]=A[k]/2
	}
if (m>j){
m=j;}
}
cout<<m<<endl;
return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope
    5 | cin>>N;
      | ^~~
a.cc:15:12: error: expected ';' before 'A'
   15 |         j++
      |            ^
      |            ;
   16 |         A[k]=A[k]/2
      |         ~   
a.cc:21:1: error: 'cout' was not declared in this scope
   21 | cout<<m<<endl;
      | ^~~~
a.cc:21:10: error: 'endl' was not declared in this scope
   21 | cout<<m<<endl;
      |          ^~~~
Language: C++

include<iostream>
include<string>
using namespace std;
int main(){
    string a;
    cin >> a;
    int str[3];
    for(int i=0;i<3;i++){
        str[i]=a[i]-'0';
    }
    int sum=0;
    for(int i=0;i<3;i++){
        sum+=str[i];
    }
    cout << sum;
    return 0;
    
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:5: error: 'string' was not declared in this scope
    5 |     string a;
      |     ^~~~~~
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> a;
      |     ^~~
a.cc:6:12: error: 'a' was not declared in this scope
    6 |     cin >> a;
      |            ^
a.cc:15:5: error: 'cout' was not declared in this scope
   15 |     cout << sum;
      |     ^~~~
Language: C

#include<stdio.h>

int main(){
	int n,cnt=0;
	char c;
	c=getchar();
	while(c!=EOF){
		if(c == '1')cnt++;
		c = getchar()
	}
	printf("%d\n",cnt);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:30: error: expected ';' before '}' token
    9 |                 c = getchar()
      |                              ^
      |                              ;
   10 |         }
      |         ~
Language: C++

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

int main() {

	int i;

	int count = 0;

	int s[3];

	for (i = 0; i <= 2; i++) {
		cin >> s[i];
		if (s[i] == 1) {
			count++;
		}else{
		}
	}

	cout << count;


Compiler output:
a.cc: In function 'int main()':
a.cc:21:23: error: expected '}' at end of input
   21 |         cout << count;
      |                       ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

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

int main() {
	string s;
	cin >> s;
	char S[3];
	for (int i = 0; i < 3; i++) {
		S[i] = s[i];
	}
	int x = 0;
	for (int j = 0; i < 3; i++) {
		if (S[j] == 1) {
			x++;
		}
	}
	cout << x << endl;
	return 0;
}

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

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

int main() {
	string s;
	cin >> s;
	char S[3];
	for (int i = 0; i < (int)S.size(); i++) {
		S[i] = s[i];
	}
	int x = 0;
	for (int j = 0; i < (int)S.size(); i++) {
		if (S[j] == 1) {
			x++;
		}
	}
	cout << x << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:36: error: request for member 'size' in 'S', which is of non-class type 'char [3]'
    9 |         for (int i = 0; i < (int)S.size(); i++) {
      |                                    ^~~~
a.cc:13:25: error: 'i' was not declared in this scope
   13 |         for (int j = 0; i < (int)S.size(); i++) {
      |                         ^
a.cc:13:36: error: request for member 'size' in 'S', which is of non-class type 'char [3]'
   13 |         for (int j = 0; i < (int)S.size(); i++) {
      |                                    ^~~~
Language: C++

#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
int main(){
	string a;
	int ans=0;
	scanf("%s",&a);
	for(int i=0;i<a.length();a++)
		if(a[i]=='1')
			ans++;
	printf("%d",ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:35: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
    9 |         for(int i=0;i<a.length();a++)
      |                                  ~^~
Language: C++

#include<stdio.h>
int main()
{
	char ly[3];
	int i,sum=0;
	gets(ly);
	for(i=0;i<3;i++)
	sum+=ly[i]-'0';
	printf("%d\n",sum);
}

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(ly);
      |         ^~~~
      |         getw
Language: C++

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

int main() {
	string s;
	cin >> s;
	char S[3];
	for (int i = 0; i < (int)S.size(); ++i) {
		S[i] = s[i];
	}
	int x = 0;
	if (s1 == 1) {
		x++;
	}
	if (s2 == 1) {
		x++;
	}
	if (s3 == 1) {
		x++;
	}
	cout << x << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:36: error: request for member 'size' in 'S', which is of non-class type 'char [3]'
    9 |         for (int i = 0; i < (int)S.size(); ++i) {
      |                                    ^~~~
a.cc:13:13: error: 's1' was not declared in this scope; did you mean 's'?
   13 |         if (s1 == 1) {
      |             ^~
      |             s
a.cc:16:13: error: 's2' was not declared in this scope; did you mean 's'?
   16 |         if (s2 == 1) {
      |             ^~
      |             s
a.cc:19:13: error: 's3' was not declared in this scope; did you mean 's'?
   19 |         if (s3 == 1) {
      |             ^~
      |             s
Language: C++

#include <iostream>

using namespace std;

int main()
{
    int n,sum;
    sum=0;
    cin>>n;
    for(int i=0;i<3;++i){
        if(n/2 %= 0)sum++;
        n=n/10;
    }
    cout << sum << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: warning: division by zero [-Wdiv-by-zero]
   11 |         if(n/2 %= 0)sum++;
      |            ~~~~^~~~
a.cc:11:13: error: lvalue required as left operand of assignment
   11 |         if(n/2 %= 0)sum++;
      |            ~^~
Language: C++

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

int main() {
	string s;
	char S[3];
	for (int i = 0; i < (int)S.size(); ++i) {
		S[i] = s[i];
	}
	int x = 0;
	cin >> s1 >> s2 >> s3;
	if (s1 == 1) {
		x++;
	}
	if (s2 == 1) {
		x++;
	}
	if (s3 == 1) {
		x++;
	}
	cout << x << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:36: error: request for member 'size' in 'S', which is of non-class type 'char [3]'
    8 |         for (int i = 0; i < (int)S.size(); ++i) {
      |                                    ^~~~
a.cc:12:16: error: 's1' was not declared in this scope; did you mean 's'?
   12 |         cin >> s1 >> s2 >> s3;
      |                ^~
      |                s
a.cc:12:22: error: 's2' was not declared in this scope; did you mean 's'?
   12 |         cin >> s1 >> s2 >> s3;
      |                      ^~
      |                      s
a.cc:12:28: error: 's3' was not declared in this scope; did you mean 's'?
   12 |         cin >> s1 >> s2 >> s3;
      |                            ^~
      |                            s
Language: C++

#include <vector>
using namespace std;
int main(){
  int s, c = 0;
  cin >> s;
  if(s == 0)cout << 0;
  if(s == 1 || s == 10 || s == 100)cout << 1;
  if(s == 11 || s == 110 || s == 101)cout << 2;
  if(s == 111)cout << 3;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> s;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <vector>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:6:13: error: 'cout' was not declared in this scope
    6 |   if(s == 0)cout << 0;
      |             ^~~~
a.cc:6:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:7:36: error: 'cout' was not declared in this scope
    7 |   if(s == 1 || s == 10 || s == 100)cout << 1;
      |                                    ^~~~
a.cc:7:36: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:8:38: error: 'cout' was not declared in this scope
    8 |   if(s == 11 || s == 110 || s == 101)cout << 2;
      |                                      ^~~~
a.cc:8:38: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:15: error: 'cout' was not declared in this scope
    9 |   if(s == 111)cout << 3;
      |               ^~~~
a.cc:9:15: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: Java

import static java.lang.Math.*;
import static  java.util.Arrays.*;
import java.io.*;
import java.util.*;

class Scanner {
    BufferedReader br;
    StringTokenizer st;
    Scanner(InputStream in) {
        br = new BufferedReader(new InputStreamReader(in));
        eat("");
    }
    void eat(String s) {
        st = new StringTokenizer(s);
    }
    String nextLine() {
        try {
            return br.readLine();
        } catch (IOException e) {
            throw new IOError(e);
        }
    }
    boolean hasNext() {
        while (!st.hasMoreTokens()) {
            String s = nextLine();
            if (s == null) return false;
            eat(s);
        }
        return true;
    }
    String next() {
        hasNext();
        return st.nextToken();
    }
    int nextInt() {
        return Integer.parseInt(next());
    }
    long nextLong() {
        return Long.parseLong(next());
    }
    double nextDouble() {
        return Double.parseDouble(next());
    }
}

public class Solution {
    void run() {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int cnt = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '1') cnt++;
        }
        System.out.println(cnt);
    }

    static public void main(String[] args) {
        new Solution().run();
    }
}

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

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;

int main(){
	scanf("%d",&A);

	if (A == 000) cout << "0" << endl;
	if (A == 001) cout << "1" << endl;
	if (A == 011) cout << "2" << endl;
	if (A == 111) cout << "3" << endl;
	if (A == 110) cout << "2" << endl;
	if (A == 100) cout << "1" << endl;
	if (A == 010) cout << "1" << endl; 

}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: 'A' was not declared in this scope
   15 |         scanf("%d",&A);
      |                     ^
Language: C

#include <stdio.h>

int main(){
        char a;
        int cnt=0;
        for (int i=0;i<3;i++) {
        scanf("%c", &a);
        if (a == '1') cnt++;
        }
        printf("%d\n", cnt);
}
~ 

Compiler output:
main.c:12:1: error: expected identifier or '(' before '~' token
   12 | ~
      | ^
Language: C++

#include<iostream>
#include<cstdio>
#include<map>
#include<cstring>
#include<string>
#include<algorithm>
#include<queue>
#include<vector>
#include<stack>
#include<cstdlib>
#include<cctype>
#include<cmath>
#define ll long long
#define inf 99999999
using namespace std;
char a[4];
int main()
{

    gets(a);
    int res=0;
    for(int i=0;i<3;i++){
        if(a[i]=='1'){
            ++res;
        }
    }
    cout<<res<<endl;
    return 0;
}

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

#include<isotream>
using namespace std;
int main()
{
	char a[3];
	for(int i=1;i<=3;i++)
	{
		if(a[i-1]=='0')
		{
			cout<<i<<endl;
			return 0;
		}
	}
	cout<<"0"<<endl;
}

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