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

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = getInputString(sc);
 
        // programming
        int[] l = toIntegerList(s);
        int sum = 0;
        for (int v : l) {
            v += sum;
        }
        output(String.valueOf(sum));
	}

	public static String getInputString(Scanner sc) {
		return sc.next();
	}

	public static int getInputInteger(Scanner sc) {
		return Integer.parseInt(sc.next());
	}

	public static void output(String... params) {
		boolean isInit = true;
		String str = "";
		for (String s : params) {
			if (!isInit) {
				str += " ";
			}
			str += s;
			isInit = false;
		}
		System.out.println(str);
	}

    public static int[] toIntegerList(String s) {
        String[] ret = new String[s.length()];
        for (int i = 0; i < s.length; i++) {
            ret[i] = Integer.parseInt(String.valueOf(s.charAt(i)));
        }
        return ret;
    }
}

Compiler output:
Main.java:39: error: cannot find symbol
        for (int i = 0; i < s.length; i++) {
                             ^
  symbol:   variable length
  location: variable s of type String
Main.java:40: error: incompatible types: int cannot be converted to String
            ret[i] = Integer.parseInt(String.valueOf(s.charAt(i)));
                                     ^
Main.java:42: error: incompatible types: String[] cannot be converted to int[]
        return ret;
               ^
3 errors
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(void){
  string s;
  int count = 0;
  
  cin >> s;
  
  for(int i = 0 ; i < 3 ; i++){
    if(s[i] == "1") count++;
  }
  cout << count << endl;
  
  return 0;
}

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

    public class Main {
      public static void main(String[] args) {
    	java.util.Scanner scanner = new java.util.Scanner(System.in);
    	int n = scanner.nextInt();
    	int[] a = new int[n];
    	for (int i = 0; i < n; i++) {
    		a[i] = scanner.nextInt();
    	}
     
    	int[] count = new int[n];
    	for (int i = 0; i < n; i++) {
                            // 2で割れる回数をチェック
    		while (a[i] % 2 == 0) {
    			a[i] = a[i] / 2;
    		count[i]++;
    		}
    	}
           Arrays.sort(count);
    	System.out.println(count[0]);
      }
    }

Compiler output:
Main.java:18: error: cannot find symbol
           Arrays.sort(count);
           ^
  symbol:   variable Arrays
  location: class Main
1 error
Language: C++

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

 
int main() {
  int x,a;
  cin >> x;
  while (x >= 0){
    if (x >= 100){
      a = a+1;
      x = x -100
    }else if(x >= 10){
      a = a+1;
      x = x-10;
    }
    return 0;
  }
  return 0;
  cout << a << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   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:11:17: error: expected ';' before '}' token
   11 |       x = x -100
      |                 ^
      |                 ;
   12 |     }else if(x >= 10){
      |     ~            
a.cc:19:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 |   cout << a << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:19:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   19 |   cout << a << endl;
      |                ^~~~
      |                std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
#inlcude<string>
using namespace std;
int main()
{
  string s;
  cin >> s;
  int counter;
  if(s[0] == '1')++counter;
  if(s[1] == '1')++counter;
  if(s[2] == '1')++counter;
  cout << counter << endl;
}


Compiler output:
a.cc:2:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    2 | #inlcude<string>
      |  ^~~~~~~
      |  include
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>

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

    std::cout<<std::coun(s.begin(), s.end(), '1')
        <<std::endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:21: error: 'coun' is not a member of 'std'; did you mean 'cout'?
   14 |     std::cout<<std::coun(s.begin(), s.end(), '1')
      |                     ^~~~
      |                     cout
Language: C++

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

int main(){
  int S1, S2, S3, a1, a2, a3;
  cin >> S1S2S3;
  a1 = S1 % 2;
  a2 = S2 % 2;
  a3 = S3 % 2;
  cout << a1+a2+a3 <<endl;
}

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

#include<iostream>
using namespace std;

	int main(void){
		int count = 0;
		int a;
		while(cin >> a){
			if(a == 1){
				cout ++;
			}
		}
cout << count << endl;
		return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:38: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
    9 |                                 cout ++;
      |                                 ~~~~~^~
Language: C++

#include <iostream>
#include <string>

using namespace std;

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

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

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

int main() {
  // ここにプログラムを追記
  int a ;
  cin >> a;
  b = a % 3
  cout << b << endl;
  
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'b' was not declared in this scope
    8 |   b = a % 3
      |   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string number;
  int count;
  count = 0;
  for (int i = 0; i < 3; i++ ){
  cin >> number ;
  if (number = 1) ++count;}
  
  cout << count <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: could not convert 'number.std::__cxx11::basic_string<char>::operator=(1)' from 'std::__cxx11::basic_string<char>' to 'bool'
    9 |   if (number = 1) ++count;}
      |       ~~~~~~~^~~
      |              |
      |              std::__cxx11::basic_string<char>
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string number;
  int count;
  count = 0;
  for (int 1 = 0; i < 3; i++ ){
  cin >> number ;
  if (number == 1) ++count;}
  
  cout << count <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: expected unqualified-id before numeric constant
    7 |   for (int 1 = 0; i < 3; i++ ){
      |            ^
a.cc:7:11: error: expected ';' before numeric constant
    7 |   for (int 1 = 0; i < 3; i++ ){
      |           ^~
      |           ;
a.cc:7:12: error: lvalue required as left operand of assignment
    7 |   for (int 1 = 0; i < 3; i++ ){
      |            ^
a.cc:7:19: error: 'i' was not declared in this scope
    7 |   for (int 1 = 0; i < 3; i++ ){
      |                   ^
a.cc:7:24: error: expected ')' before ';' token
    7 |   for (int 1 = 0; i < 3; i++ ){
      |       ~                ^
      |                        )
a.cc:7:26: error: 'i' was not declared in this scope
    7 |   for (int 1 = 0; i < 3; i++ ){
      |                          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string number , count;
  count = 0;
  cin >> number;
  if (number[0] == 1) ++count;
  if (number[1] == 1) ++count;
  if (number[2] == 1) ++count;
  cout << count <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: ambiguous overload for 'operator=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
    5 |   count = 0;
      |           ^
In file included from /usr/include/c++/14/string:54,
                 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/basic_string.h:817:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  817 |       operator=(const basic_string& __str)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:828:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  828 |       operator=(const _CharT* __s)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:840:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  840 |       operator=(_CharT __c)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:858:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
  858 |       operator=(basic_string&& __str)
      |       ^~~~~~~~
a.cc:7:23: error: no match for 'operator++' (operand type is 'std::string' {aka 'std::__cxx11::basic_string<char>'})
    7 |   if (number[0] == 1) ++count;
      |                       ^~~~~~~
a.cc:8:23: error: no match for 'operator++' (operand type is 'std::string' {aka 'std::__cxx11::basic_string<char>'})
    8 |   if (number[1] == 1) ++count;
      |                       ^~~~~~~
a.cc:9:23: error: no match for 'operator++' (operand type is 'std::string' {aka 'std::__cxx11::basic_string<char>'})
    9 |   if (number[2] == 1) ++count;
      |                       ^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string number , count;
  cin >> number;
  if (number[0] == 1) ++count;
  if (number[1] == 1) ++count;
  if (number[2] == 1) ++count;
  cout << count <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:23: error: no match for 'operator++' (operand type is 'std::string' {aka 'std::__cxx11::basic_string<char>'})
    6 |   if (number[0] == 1) ++count;
      |                       ^~~~~~~
a.cc:7:23: error: no match for 'operator++' (operand type is 'std::string' {aka 'std::__cxx11::basic_string<char>'})
    7 |   if (number[1] == 1) ++count;
      |                       ^~~~~~~
a.cc:8:23: error: no match for 'operator++' (operand type is 'std::string' {aka 'std::__cxx11::basic_string<char>'})
    8 |   if (number[2] == 1) ++count;
      |                       ^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int number , count;
  cin >> number;
  if (number[0] == 1) ++count;
  if (number[1] == 1) ++count;
  if (number[2] == 1) ++count;
  cout << count <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: invalid types 'int[int]' for array subscript
    6 |   if (number[0] == 1) ++count;
      |             ^
a.cc:7:13: error: invalid types 'int[int]' for array subscript
    7 |   if (number[1] == 1) ++count;
      |             ^
a.cc:8:13: error: invalid types 'int[int]' for array subscript
    8 |   if (number[2] == 1) ++count;
      |             ^
Language: C++

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

int main() {
  string s;
  cin>>s;
  int count=0;
  if (s[0]=="1") ++count;
  if (s[1]=="1") ++count;
  if (s[2]=="1") ++count;
  cout<<count<<endl;
}

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

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

int main() {
	string s;
	cin >> s;
	int counter=0;
	if (s[0]=="1") ++counter;
	if (s[1]=="1") ++counter;
	if (s[2]=="1") ++counter;
	cout<< counter <<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |         if (s[0]=="1") ++counter;
a.cc:10:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         if (s[1]=="1") ++counter;
a.cc:11:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         if (s[2]=="1") ++counter;
Language: C++

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

int main() {
	string s;
	cin >> s;
	int counter=0;
	if (s[0]=="1") ++counter;
	if (s[1]=="1") ++counter;
	if (s[2]=="1") ++counter;
	cout<< counter <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |         if (s[0]=="1") ++counter;
a.cc:10:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         if (s[1]=="1") ++counter;
a.cc:11:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         if (s[2]=="1") ++counter;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: expected '(' before 's'
    8 |                 if s[i]=='1'
      |                    ^
      |                    (
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: expected initializer before 'cin'
    6 |         cin>>s;
      |         ^~~
a.cc:8:20: error: expected '(' before 's'
    8 |                 if s[i]=='1'
      |                    ^
      |                    (
a.cc:11:15: error: 'n' was not declared in this scope
   11 |         cout<<n<<endl;
      |               ^
Language: C++

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

int main() {
  // ここにプログラムを追記
int a;
int b= 0;
  cin >> a;
if(a%10==1)b++;
 if((a/10)%10)==1)b++;
  if((a/100)%10==1)b++;
  cout << b; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: expected primary-expression before '==' token
   10 |  if((a/10)%10)==1)b++;
      |               ^~
Language: C++

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

int main() {
    int a;
    cin >> a;
    if (a == 111){
      cout << 3 << endl;
    else
      cout << a % 3 <<endl;
    }      
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: expected '}' before 'else'
    9 |     else
      |     ^~~~
a.cc:7:18: note: to match this '{'
    7 |     if (a == 111){
      |                  ^
a.cc: At global scope:
a.cc:12:1: error: expected declaration before '}' token
   12 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int a;
	cin >>a;
  
  int s1 = a%10;  				//1
  int s2 = (a/10)%10<<endl;     //10
  int s3 = a/100; 				//100	
   cout <<s1+s2+s3<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    9 |   int s2 = (a/10)%10<<endl;     //10
      |            ~~~~~~~~~^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int a;
	cin >>a;
  
  int s1 = a%10;
  	  s2 = (a*10-a+1)/1000;
  	  s3 = a/100;
   cout <<s1+s2+s3<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: 's2' was not declared in this scope; did you mean 's1'?
    9 |           s2 = (a*10-a+1)/1000;
      |           ^~
      |           s1
a.cc:10:11: error: 's3' was not declared in this scope; did you mean 's1'?
   10 |           s3 = a/100;
      |           ^~
      |           s1
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
	cin >>a>>b>>c;
    cout <<a+b+c<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:15: error: 'a' was not declared in this scope
    5 |         cin >>a>>b>>c;
      |               ^
a.cc:5:18: error: 'b' was not declared in this scope
    5 |         cin >>a>>b>>c;
      |                  ^
a.cc:5:21: error: 'c' was not declared in this scope
    5 |         cin >>a>>b>>c;
      |                     ^
Language: C++

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

int main()｛
string s;
cin >> s;
int ans = 0;
for(int i = 0 ; i < 3 ;i++)｛
ans += s[i]-'0';
}
cout << ans << endl;
return 0;
}

Compiler output:
a.cc:4:11: error: expected initializer before '\U0000ff5b'
    4 | int main()｛
      |           ^~
a.cc:6:1: error: 'cin' does not name a type
    6 | cin >> s;
      | ^~~
a.cc:8:1: error: expected unqualified-id before 'for'
    8 | for(int i = 0 ; i < 3 ;i++)｛
      | ^~~
a.cc:8:17: error: 'i' does not name a type
    8 | for(int i = 0 ; i < 3 ;i++)｛
      |                 ^
a.cc:8:24: error: 'i' does not name a type
    8 | for(int i = 0 ; i < 3 ;i++)｛
      |                        ^
a.cc:10:1: error: expected declaration before '}' token
   10 | }
      | ^
a.cc:11:1: error: 'cout' does not name a type
   11 | cout << ans << endl;
      | ^~~~
a.cc:12:1: error: expected unqualified-id before 'return'
   12 | return 0;
      | ^~~~~~
a.cc:13:1: error: expected declaration before '}' token
   13 | }
      | ^
Language: C++

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

int main() {
    string S;
    cin >> S;
    int count=0;
    for(int i=0;i<N;i++){
     if (S.at(i)='1') {
        count++;
     }
    }

    cout << count << endl;
}


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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s:
  cin >> s;
  int count =0;
  if(s[0] == '1') count++;
  if(s[1] == '1') count++;
  if(s[2] == '1') count++;
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: found ':' in nested-name-specifier, expected '::'
    5 |   string s:
      |           ^
      |           ::
a.cc:5:10: error: 's' has not been declared
    5 |   string s:
      |          ^
a.cc:6:7: error: qualified-id in declaration before '>>' token
    6 |   cin >> s;
      |       ^~
a.cc:8:6: error: 's' was not declared in this scope
    8 |   if(s[0] == '1') count++;
      |      ^
a.cc:9:6: error: 's' was not declared in this scope
    9 |   if(s[1] == '1') count++;
      |      ^
a.cc:10:6: error: 's' was not declared in this scope
   10 |   if(s[2] == '1') count++;
      |      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s:
  cin >> s;
  int count =0;
  if(s[0] == 1) count++;
  if(s[1] == 1) count++;
  if(s[2] == 1) count++;
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: found ':' in nested-name-specifier, expected '::'
    5 |   string s:
      |           ^
      |           ::
a.cc:5:10: error: 's' has not been declared
    5 |   string s:
      |          ^
a.cc:6:7: error: qualified-id in declaration before '>>' token
    6 |   cin >> s;
      |       ^~
a.cc:8:6: error: 's' was not declared in this scope
    8 |   if(s[0] == 1) count++;
      |      ^
a.cc:9:6: error: 's' was not declared in this scope
    9 |   if(s[1] == 1) count++;
      |      ^
a.cc:10:6: error: 's' was not declared in this scope
   10 |   if(s[2] == 1) count++;
      |      ^
Language: C++

#include<iostream>
#include<string>


int main(){
    string s;
    cin>>s;
    int counter = 0;
    if (s[0]=='1') counter++;
    if (s[1]=='1') counter++;
    if (s[2]=='1') counter++;
    cout<<s<<endl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'string' was not declared in this scope
    6 |     string s;
      |     ^~~~~~
a.cc:6:5: 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:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |     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:7:10: error: 's' was not declared in this scope
    7 |     cin>>s;
      |          ^
a.cc:12:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |     cout<<s<<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:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 |     cout<<s<<endl;
      |              ^~~~
      |              std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

using VI = vector<int>;
using VVI = vector<VI>;
using VVVI = vector<VVI>;
using VB = vector<bool>;
using VVB = vector<VB>;

int main(){
  char U[3];
  scanf("%s",U,3);
  int ans = 0;
  REP(i,3) if(U[i] == '1') ans++;
  printf("%d\n",ans);
  return 0;
}

Compiler output:
a.cc:1:12: error: 'vector' does not name a type
    1 | using VI = vector<int>;
      |            ^~~~~~
a.cc:2:13: error: 'vector' does not name a type
    2 | using VVI = vector<VI>;
      |             ^~~~~~
a.cc:3:14: error: 'vector' does not name a type
    3 | using VVVI = vector<VVI>;
      |              ^~~~~~
a.cc:4:12: error: 'vector' does not name a type
    4 | using VB = vector<bool>;
      |            ^~~~~~
a.cc:5:13: error: 'vector' does not name a type
    5 | using VVB = vector<VB>;
      |             ^~~~~~
a.cc: In function 'int main()':
a.cc:9:3: error: 'scanf' was not declared in this scope
    9 |   scanf("%s",U,3);
      |   ^~~~~
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   REP(i,3) if(U[i] == '1') ans++;
      |       ^
a.cc:11:3: error: 'REP' was not declared in this scope
   11 |   REP(i,3) if(U[i] == '1') ans++;
      |   ^~~
a.cc:12:3: error: 'printf' was not declared in this scope
   12 |   printf("%d\n",ans);
      |   ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | using VI = vector<int>;
Language: C++

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

int main() {
  string s;
  cin >> s;
  int ans = 0;
  if (s[0] == '1') c++;
  if (s[1] == '1') c++;
  if (s[2] == '1') c++;
  cout << c << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: 'c' was not declared in this scope
   10 |   if (s[0] == '1') c++;
      |                    ^
a.cc:11:20: error: 'c' was not declared in this scope
   11 |   if (s[1] == '1') c++;
      |                    ^
a.cc:12:20: error: 'c' was not declared in this scope
   12 |   if (s[2] == '1') c++;
      |                    ^
a.cc:13:11: error: 'c' was not declared in this scope
   13 |   cout << c << endl;
      |           ^
Language: Java


import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		String a = sc.next();
		a = a.replaceAll("0", "");
		System.out.println(a.length())
	}

}


Compiler output:
Main.java:10: error: ';' expected
		System.out.println(a.length())
		                              ^
1 error
Language: C++

#include<iostream>
using namespace std;
int main(){                                                                                                    
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  int a;
  cin>>a;
  if(a==111){
    cout<<3<<endl;
  }
  else if(a==011||a==101||a=110){
    cout<<2<<endl;
  }
  else if(a==000){
    cout<<0<<endl;
  }
  else{
    cout<<1<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:25: error: lvalue required as left operand of assignment
   33 |   else if(a==011||a==101||a=110){
      |           ~~~~~~~~~~~~~~^~~
Language: C++

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

main(){
 int ans=0;
 char s[3];
 cin >> s[0] >> s[1] >> s[2];
 if (s[0]== "1") ans++;
 if (s[1]== "1") ans++;
 if (s[2]== "1") ans++;
 cout << ans << endl;
}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |  if (s[0]== "1") ans++;
      |      ~~~~^~~~~~
a.cc:9:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |  if (s[1]== "1") ans++;
      |      ~~~~^~~~~~
a.cc:10:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |  if (s[2]== "1") ans++;
      |      ~~~~^~~~~~
Language: C++

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

main(){
 int ans=0;
 char s[3];
 cin >> s[0] >> s[1] >> s[2];
 if (s[0]=="1") ans++;
 if (s[1]=="1") ans++;
 if (s[2]=="1") ans++;
 cout << ans << endl;
}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |  if (s[0]=="1") ans++;
      |      ~~~~^~~~~
a.cc:9:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |  if (s[1]=="1") ans++;
      |      ~~~~^~~~~
a.cc:10:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |  if (s[2]=="1") ans++;
      |      ~~~~^~~~~
Language: C++

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

main(){
 int ans=0;
 char s[3];
 cin >> s[0] >> s[1] >> s[2];
 if (s[0]=="1") ans++;
 if (s[1]=="1") ans++;
 if (s[2]=="1") ans++;
 cout << ans << endl;
}

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |  if (s[0]=="1") ans++;
      |      ~~~~^~~~~
a.cc:10:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |  if (s[1]=="1") ans++;
      |      ~~~~^~~~~
a.cc:11:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |  if (s[2]=="1") ans++;
      |      ~~~~^~~~~
Language: C++

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

int main(){
  int s=0, s1=0, s2=0, s3=0;
  cin >> s;
  s1 = s / 100;
  s3 = s % 10;
  s2 = (s - s3)/10%10
  cout << s1 + s2 + s3 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:22: error: expected ';' before 'cout'
   10 |   s2 = (s - s3)/10%10
      |                      ^
      |                      ;
   11 |   cout << s1 + s2 + s3 << endl;
      |   ~~~~
Language: C++

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

main(){
 int ans=0;
 char s[3];
 cin >> s[0] >> s[1] >> s[2];
 if (s[0]== "1" ) ans++;
 if (s[1]== "1" ) ans++;
 if (s[2]== "1" ) ans++;
 cout << ans << endl;
}

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |  if (s[0]== "1" ) ans++;
      |      ~~~~^~~~~~
a.cc:10:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |  if (s[1]== "1" ) ans++;
      |      ~~~~^~~~~~
a.cc:11:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |  if (s[2]== "1" ) ans++;
      |      ~~~~^~~~~~
Language: C++

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

main(){
 int ans=0;
 string s;
 cin >> s;
 if (s[0]== "1" ) ans++;
 if (s[1]== "1" ) ans++;
 if (s[2]== "1" ) ans++;
 cout << ans << endl;
}

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |  if (s[0]== "1" ) ans++;
a.cc:10:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |  if (s[1]== "1" ) ans++;
a.cc:11:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |  if (s[2]== "1" ) ans++;
Language: C++

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

main(){int ans;
string s;
int main(){
 cin >> s;
 if (s[0]== 1 ) ans++;
 if (s[1]== 1 ) ans++;
 if (s[2]== 1 ) ans++;
 cout << ans << endl;
}

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){int ans;
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
    7 | int main(){
      |         ^~
a.cc:7:9: note: remove parentheses to default-initialize a variable
    7 | int main(){
      |         ^~
      |         --
a.cc:7:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:7:11: error: a function-definition is not allowed here before '{' token
    7 | int main(){
      |           ^
a.cc:13:2: error: expected '}' at end of input
   13 | }
      |  ^
a.cc:5:7: note: to match this '{'
    5 | main(){int ans;
      |       ^
Language: C++

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

int main() {
  string s;
  cin >> s;
  
  int count=0;
  for (int i=0; i<3; i++){
  if (s[i]=="1") count++;
  }
  cout << count<< endl;
}


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

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

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


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

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

int main() {
  string s;
  cin >> s;
  
  int count=0;
  for (int i=0; i<3; i++){
  if (s[i]=="1") count++;
  }
  cout << s<< endl;
}


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   10 |   if (s[i]==1) cout++;
      |                ~~~~^~
Language: C++

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

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


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

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

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


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

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

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


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

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

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

#include <iostream>
#include <vector>
using namspace std;

int main()
{
    int n = 3, count = 0, temp;
    while(n--)
    {
        cin >> temp;
        if(temp == 1)
        {
            count++;
        }
    }
    cout << count << endl;

    return 0;
}


Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'namspace'
    3 | using namspace std;
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:10:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |         cin >> temp;
      |         ^~~
      |         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:16:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |     cout << count << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 |     cout << count << endl;
      |                      ^~~~
      |                      std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main() {
	int a;
	cin >> a;
  if(a==000){
    cout<<0;}
  if(a==100||a==010||a==001){
    cout<<1;}
  if(a==110||a==101||a==011){
    cout<<2;}
  if(a==111)
     cout<<3;}
}

Compiler output:
a.cc:15:1: error: expected declaration before '}' token
   15 | }
      | ^
Language: C++

#include,bits/stdc++.h>
using namespace std;
 
int main() {
	int a;
	cin >> a;
  if(a==000){
    cout<<0;}
  if(a==100||a==010||a==001){
    cout<<1;}
  if(a==110||a==101||a==011){
    cout<<2;}
   else{
     cout<<3;}
}

Compiler output:
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include,bits/stdc++.h>
      |         ^
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin >> a;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #include,bits/stdc++.h>
a.cc:8:5: error: 'cout' was not declared in this scope
    8 |     cout<<0;}
      |     ^~~~
a.cc:8:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:5: error: 'cout' was not declared in this scope
   10 |     cout<<1;}
      |     ^~~~
a.cc:10:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:5: error: 'cout' was not declared in this scope
   12 |     cout<<2;}
      |     ^~~~
a.cc:12:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:6: error: 'cout' was not declared in this scope
   14 |      cout<<3;}
      |      ^~~~
a.cc:14:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

int main() {
	int a;
	cin >> a;
  if(a==000){
    cout<<0;}
  if(a==100||a==010||a==001){
    cout<<1;{
  if(a==110||a==101||a==011){
    cout<<2;}
   else{
     cout<<3;}
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: expected '}' at end of input
   15 |  }
      |   ^
a.cc:9:29: note: to match this '{'
    9 |   if(a==100||a==010||a==001){
      |                             ^
a.cc:15:3: error: expected '}' at end of input
   15 |  }
      |   ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include<iostream>
#include<string>

using namespace std;

int main(){
	string s;
	cin >> s;
	int counter=0;
	if(s[0]=="1") ++counter;
	if(s[1]=="1") ++counter;
	if(s[2]=="1") ++counter;
	cout << counter << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         if(s[0]=="1") ++counter;
a.cc:11:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         if(s[1]=="1") ++counter;
a.cc:12:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |         if(s[2]=="1") ++counter;
Language: C++

/**
 *      ABC 81 A
 *      author  : kyomukyomupurin
 *      created : 2018-09-02 04:16:35
**/

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    string s; cin >> s;
    int count = 0;
    for (int i = 0; i < 3; ++i) {
        if (s[0] == "1"){
            ++count;
        }
            
    }
    cout << count;
    return 0;
}



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

/**
 *      ABC 81 A
 *      author  : kyomukyomupurin
 *      created : 2018-09-02 04:16:35
**/

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    string s; cin >> s;
    int count = 0;
    for (int i = 0; i < 4; ++i) {
        if (s[0] == "1"){
            ++count;
        }
            
    }
    cout << count;
    return 0;
}



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

#include<bits/stdc++.h>
using namespace std;
int main(){
  sting s;
    cin>>s;
  cout<<((int)(s[0])-'0')+((int)(s[1])-'0')+((int)(s[2])-'0')<<endl;
  return 0;
}


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

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
const int MOD=(int)1e9+7;
using namespace std;
int main(){
    string a;
    cin>>a;
    int ans=0;
if(ans[0]=='1') ans++;
if(ans[1]=='1') ans++;
if(ans[2]=='1') ans++;
cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: invalid types 'int[int]' for array subscript
    9 | if(ans[0]=='1') ans++;
      |       ^
a.cc:10:7: error: invalid types 'int[int]' for array subscript
   10 | if(ans[1]=='1') ans++;
      |       ^
a.cc:11:7: error: invalid types 'int[int]' for array subscript
   11 | if(ans[2]=='1') ans++;
      |       ^
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
const int MOD=(int)1e9+7;
using namespace std;
int main(){
    string a;
    cin>>a;
    int ans;
if(ans[0]=='1') ans++;
if(ans[1]=='1') ans++;
if(ans[2]=='1') ans++;
cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: invalid types 'int[int]' for array subscript
    9 | if(ans[0]=='1') ans++;
      |       ^
a.cc:10:7: error: invalid types 'int[int]' for array subscript
   10 | if(ans[1]=='1') ans++;
      |       ^
a.cc:11:7: error: invalid types 'int[int]' for array subscript
   11 | if(ans[2]=='1') ans++;
      |       ^
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
const int MOD=(int)1e9+7;
using namespace std;
int main(){
    string a;
    cin>>a;
    int ans=0;
if(ans[0]==1) ans++;
if(ans[1]==1) ans++;
if(ans[2]==1) ans++;
cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: invalid types 'int[int]' for array subscript
    9 | if(ans[0]==1) ans++;
      |       ^
a.cc:10:7: error: invalid types 'int[int]' for array subscript
   10 | if(ans[1]==1) ans++;
      |       ^
a.cc:11:7: error: invalid types 'int[int]' for array subscript
   11 | if(ans[2]==1) ans++;
      |       ^
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
const int MOD=(int)1e9+7;
using namespace std;
int main(){
    string a;
    cin>>a;
    int ans;
if(ans[0]==1) ans++;
if(ans[1]==1) ans++;
if(ans[2]==1) ans++;
cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: invalid types 'int[int]' for array subscript
    9 | if(ans[0]==1) ans++;
      |       ^
a.cc:10:7: error: invalid types 'int[int]' for array subscript
   10 | if(ans[1]==1) ans++;
      |       ^
a.cc:11:7: error: invalid types 'int[int]' for array subscript
   11 | if(ans[2]==1) ans++;
      |       ^
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
const int MOD=(int)1e9+7;
using namespace std;
int main(){
    string a;
    cin>>a;
if(a[0]==1) a++;
if(a[1]==1) a++;
if(a[2]==1) a++;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
    8 | if(a[0]==1) a++;
      |             ~^~
a.cc:9:14: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
    9 | if(a[1]==1) a++;
      |             ~^~
a.cc:10:14: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   10 | if(a[2]==1) a++;
      |             ~^~
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
const int MOD=(int)1e9+7;
using namespace std;
int main(){
    string a=0;
    cin>>a;
if(a[0]==1) a++;
if(a[1]==1) a++;
if(a[2]==1) a++;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
    8 | if(a[0]==1) a++;
      |             ~^~
a.cc:9:14: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
    9 | if(a[1]==1) a++;
      |             ~^~
a.cc:10:14: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   10 | if(a[2]==1) a++;
      |             ~^~
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
const int MOD=(int)1e9+7;
using namespace std;
int main(){
    string a;
    cin>>a=0;
if(a[0]==1) a++;
if(a[1]==1) a++;
if(a[2]==1) a++;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: no match for 'operator=' (operand types are 'std::basic_istream<char>' and 'int')
    7 |     cin>>a=0;
      |            ^
In file included 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,
                 from a.cc:1:
/usr/include/c++/14/istream:718:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator=(std::basic_istream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]'
  718 |       operator=(basic_istream&& __rhs)
      |       ^~~~~~~~
/usr/include/c++/14/istream:718:33: note:   no known conversion for argument 1 from 'int' to 'std::basic_istream<char>&&'
  718 |       operator=(basic_istream&& __rhs)
      |                 ~~~~~~~~~~~~~~~~^~~~~
a.cc:8:14: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
    8 | if(a[0]==1) a++;
      |             ~^~
a.cc:9:14: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
    9 | if(a[1]==1) a++;
      |             ~^~
a.cc:10:14: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   10 | if(a[2]==1) a++;
      |             ~^~
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
const int MOD=(int)1e9+7;
using namespace std;
int main(){
    char a;
    cin>>a;
    cout<<a[0]+a[1]+a[2]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: invalid types 'char[int]' for array subscript
    8 |     cout<<a[0]+a[1]+a[2]<<endl;
      |            ^
a.cc:8:17: error: invalid types 'char[int]' for array subscript
    8 |     cout<<a[0]+a[1]+a[2]<<endl;
      |                 ^
a.cc:8:22: error: invalid types 'char[int]' for array subscript
    8 |     cout<<a[0]+a[1]+a[2]<<endl;
      |                      ^
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
const int MOD=(int)1e9+7;
using namespace std;
int main(){
    string a;
    cin>>a;
    cout<<char[0]+char[1]+char[2]<<endl;
}

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

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
const int MOD=(int)1e9+7;
using namespace std;
int main(){
    string a,b,c;
    cin>>a>>b>>c;
    cout<<char[0]+char[1]+char[2]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected primary-expression before 'char'
    8 |     cout<<char[0]+char[1]+char[2]<<endl;
      |           ^~~~