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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:14: error: expected initializer before '.' token
    9 |     if (int a.at(i) == 1) {
      |              ^
a.cc:9:14: error: expected ')' before '.' token
    9 |     if (int a.at(i) == 1) {
      |        ~     ^
      |              )
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: request for member 'at' in 'a', which is of non-class type 'int'
    9 |     if (a.at(i) == 1) {
      |           ^~
Language: C++

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

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

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

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

include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a;
  cin >> a;
  int b = 0;
  for (i = 0; i < 3; i++) {
    if (a[i] == 1) {
      b += 1;
    }
  }
  cout << b << endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> a;
      |   ^~~
a.cc:8:8: error: 'i' was not declared in this scope
    8 |   for (i = 0; i < 3; i++) {
      |        ^
a.cc:13:3: error: 'cout' was not declared in this scope
   13 |   cout << b << endl;
      |   ^~~~
a.cc:13:16: error: 'endl' was not declared in this scope
   13 |   cout << b << endl;
      |                ^~~~
Language: C++

include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a;
  cin >> a;
  int b = 0;
  for (i = 0; i < 3; i++) {
    if (a[i] == 1) {
      b += 1
    }
  }
  cout << b << endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> a;
      |   ^~~
a.cc:8:8: error: 'i' was not declared in this scope
    8 |   for (i = 0; i < 3; i++) {
      |        ^
a.cc:10:13: error: expected ';' before '}' token
   10 |       b += 1
      |             ^
      |             ;
   11 |     }
      |     ~        
a.cc:13:3: error: 'cout' was not declared in this scope
   13 |   cout << b << endl;
      |   ^~~~
a.cc:13:16: error: 'endl' was not declared in this scope
   13 |   cout << b << endl;
      |                ^~~~
Language: C++

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

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
    5 |   string bidama;
      |   ^~~~~~
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> bidama;
      |   ^~~
a.cc:6:10: error: 'bidama' was not declared in this scope
    6 |   cin >> bidama;
      |          ^~~~~~
a.cc:13:3: error: 'cout' was not declared in this scope
   13 |   cout << a << endl;
      |   ^~~~
a.cc:13:16: error: 'endl' was not declared in this scope
   13 |   cout << a << endl;
      |                ^~~~
Language: C++

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

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
    5 |   string bidama;
      |   ^~~~~~
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> bidama;
      |   ^~~
a.cc:6:10: error: 'bidama' was not declared in this scope
    6 |   cin >> bidama;
      |          ^~~~~~
a.cc:13:3: error: 'cout' was not declared in this scope
   13 |   cout << a << endl;
      |   ^~~~
a.cc:13:16: error: 'endl' was not declared in this scope
   13 |   cout << a << endl;
      |                ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: request for member 'at' in 'bidama', which is of non-class type 'int'
    9 |     if (bidama.at(i) == 1) {
      |                ^~
Language: C++

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

int main() {
  int bidama;
  cin >> bidama;
  int a = 0
  for (int i = 0; i < 3; i++) {
    if (bidama.at(i) == 1) {
      int a += 1;
    }
  }
  cout << a << endl;
}

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

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

int main(){
  int a,b,c,d,e;
  cin >> a;
 b=a%2;
   c=a-b;
   c=c/10;
   d=c%2;
   e=c-d;
   e=c/10;
   e=e%2;
   
   
  cout << b+d+e << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:16:25: error: expected '}' at end of input
   16 |   cout << b+d+e << endl;
      |                         ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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

int main(){
  int a,b,c,d,e;
  cin >> a;
 b=a%2;
   c=a-b;
   c=c/10;
   d=c%2;
   e=c-d;
   e=c/10;
   e=%2;
   
   
  cout << b+d+e << endl;
}

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

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

int main(){
  int a,b,c,d,e;
  cin >> a;
 b=a%2
   c=a-b
   c=c/10
   d=c%2
   e=c-d
   e=c/10
   e=%2
   
   
  cout << b+d+e << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: expected ';' before 'c'
    7 |  b=a%2
      |       ^
      |       ;
    8 |    c=a-b
      |    ~
Language: C++

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

using namespace std;

int main() {
	string str;
	cin >> str;
	cout << count(cbegin(str), cend(str), 'a');
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'count' was not declared in this scope
   10 |         cout << count(cbegin(str), cend(str), 'a');
      |                 ^~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: expected ';' before 'cout'
    7 |  d=a+b+c
      |         ^
      |         ;
    8 |   cout << d << endl;
      |   ~~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(){
  string s;
  cin>>s;
  int j = 0;
    if(s.at(0) == "1"){
      j++;
    }
    if(s.at(1) == "1"){
      j++;
    }
    if(s.at(2) == "1"){
      j++;
    }
  cout<<j<<endl;
}

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

#include <iostream>
#include <vector>
using namespace std;
int main(){
  string s;
  cin>>s;
  int j = 0;
  for(int i = 0;i < 3();i++){
    if(s.at(i) == 1){
      j++;
    }
  }
  cout<<j<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: expression cannot be used as a function
    8 |   for(int i = 0;i < 3();i++){
      |                     ~^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int S ;	
  int Y ;
  int Z ;
  cin >> S ;
  Y = S - (S/100)*100 //下二けたを抽出
  Z = Y - (Y/10)*10   //一の位を抽出
  
  cout << (S/100) + (Y/10) + Z << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: expected ';' before 'Z'
    9 |   Y = S - (S/100)*100 //下二けたを抽出
      |                      ^
      |                      ;
   10 |   Z = Y - (Y/10)*10   //一の位を抽出
      |   ~
Language: Java

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s1 = scanner.next();
        String s2[] = s1.split("");
        int count = 0;

        for(String s: s2){
            if(s.equals("1")) count++;
        }
        System.out.println(count);
    }
}


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

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    char ch = sc.next();
    ch = ch.replaceAll("0", "");
    System.out.println(ch.length());
  }
}
    

Compiler output:
Main.java:6: error: incompatible types: String cannot be converted to char
    char ch = sc.next();
                     ^
Main.java:7: error: char cannot be dereferenced
    ch = ch.replaceAll("0", "");
           ^
Main.java:8: error: char cannot be dereferenced
    System.out.println(ch.length());
                         ^
3 errors
Language: C++

#include <bits/stdc++.h>

int main(void) {
	char c;
	int i=0;

	for (int j=0; j<3; ++j){
		cin >> c;
		if (c != "1") {
			continue;	
		} else {
			++i;
		}
	}

	cout << i;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |                 cin >> 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:9:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |                 if (c != "1") {
      |                     ~~^~~~~~
a.cc:16:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |         cout << i;
      |         ^~~~
      |         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>

int main(){
    int a,b,c;
    scanf("%d",&a);
    for (int i = 0; i < 3; i++)
    {
        b = a;
        for (int f = 0; f < i; i++)
        {
            b / 10;
        }
        if (b % 2 == 1)
        {
            c++;
        }
        
    }
    printf("%d",c)
}

Compiler output:
main.c: In function 'main':
main.c:19:19: error: expected ';' before '}' token
   19 |     printf("%d",c)
      |                   ^
      |                   ;
   20 | }
      | ~
Language: C++

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

int main(){
  int s, s1, s2, s3;
  cin >> s;
  
  s3 = s % 10;
  s2 = (s - s3) % 100;
  s1 = (s - s2 * 10 - s3) % 1000:
  
  cout << s1 + s2 + s3 << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:33: error: expected ';' before ':' token
   10 |   s1 = (s - s2 * 10 - s3) % 1000:
      |                                 ^
      |                                 ;
Language: C++

#include<bits/stdc++.h>
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:10:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |   if (s[0] == "1") ++counter;
a.cc:11:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |   if (s[1] == "1") ++counter;
a.cc:12:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   if (s[2] == "1") ++counter;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: invalid types 'int[int]' for array subscript
    9 |   if(s[0]=="1") a++;
      |       ^
a.cc:9:18: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
    9 |   if(s[0]=="1") a++;
      |                 ~^~
a.cc:10:7: error: invalid types 'int[int]' for array subscript
   10 |   if(s[1]=="1") a++;
      |       ^
a.cc:10:18: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   10 |   if(s[1]=="1") a++;
      |                 ~^~
a.cc:11:7: error: invalid types 'int[int]' for array subscript
   11 |   if(s[2]=="1") a++;
      |       ^
a.cc:11:18: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   11 |   if(s[2]=="1") a++;
      |                 ~^~
Language: C++

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

int main(){
  int a;
  cin >> a;
  int a1,a2,a3 =0;
  a1 = a/100;
  a2 = a/10 -10;
  a3 = a - (a/100)*100 - (a/10 - 10)*10
  cout << a1 + a2 + a3 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:40: error: expected ';' before 'cout'
   10 |   a3 = a - (a/100)*100 - (a/10 - 10)*10
      |                                        ^
      |                                        ;
   11 |   cout << a1 + a2 + a3 << endl;
      |   ~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a;
  cin>>a;
  if(a==111)cout<<3<<endl;else{
  if(a%3==0)cout<<0<<endl;
  else{if(a%3==1)cout<<1<<endl;else{if(a%3==2)cout<<2<<endl;}}

}

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

import java.util.Scanner;

public class Atcoder_081B {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);

		int[] numbers = new int[220];
		int num;

		int N = sc.nextInt();
		for (int i=0; i<N; i++) {
			num = sc.nextInt();
			numbers[i] = num;
		}
		sc.close();

		int cnt=0;
		String judge = "all_even";
		while(true) {

			for (int i=0; i<N; i++) {
				if (numbers[i]%2!=0) {
					judge = "has_odd";
				}
			}
			if(judge=="has_odd") break;

			for (int i=0; i<N; i++) {
				numbers[i]/=2;
			}

			cnt ++;
		}
		System.out.println(cnt);


	}

}

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

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

int main() {
  int a,a1,a2,a3;
  cin >> a;
  a1=a/100;
  a2=(a%100)/10;
  a3=(a%10)
  cout << a1+a2+a3 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: expected ';' before 'cout'
    9 |   a3=(a%10)
      |            ^
      |            ;
   10 |   cout << a1+a2+a3 << endl;
      |   ~~~~
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:11:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 | if(S.at(i)=="1"){
      |    ~~~~~~~^~~~~
a.cc:12:8: error: expected ';' before '}' token
   12 | count++
      |        ^
      |        ;
   13 | }
      | ~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: 'end1' was not declared in this scope
   18 |   cout << s << end1;
      |                ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:16: error: 'end1' was not declared in this scope
   16 |   cout << s << end1;
      |                ^~~~
Language: C++

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:12: error: 'end1' was not declared in this scope
   16 |   cout<<s<<end1
      |            ^~~~
Language: C++

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:12: error: expected primary-expression before ';' token
    4 |   string s=;
      |            ^
a.cc:15:4: error: expected '}' at end of input
   15 |   }
      |    ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:12: error: expected primary-expression before ';' token
    4 |   string s=;
      |            ^
a.cc:10:9: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int&)'
   10 |     if(s(i)==1)
      |        ~^~~
a.cc:15:4: error: expected '}' at end of input
   15 |   }
      |    ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin>>s;
    int sum;

  for(int i=0;i<3;i++){
    if(s(i)==1)
      sum=sum+1;
    else
      sum=sum+0;
      
  }

  cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int&)'
    9 |     if(s(i)==1)
      |        ~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,;
  cin>>a;
  cout<<a/100+(a/10-10)+a%100%10<<endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: expected unqualified-id before ';' token
    5 |   int a,;
      |         ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'a' was not declared in this scope
    7 |   cout<<a+b+c<<endl;}
      |         ^
a.cc:7:11: error: 'b' was not declared in this scope
    7 |   cout<<a+b+c<<endl;}
      |           ^
a.cc:7:13: error: 'c' was not declared in this scope
    7 |   cout<<a+b+c<<endl;}
      |             ^
Language: C++

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

int main() {
  string s;
  cin >> s;
  int c = 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:9:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |   if (s[0] == "1") c++;
a.cc:10:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |   if (s[1] == "1") c++;
a.cc:11:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |   if (s[2] == "1") c++;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: expected ';' before '}' token
   10 |         a++
      |            ^
      |            ;
   11 |     }
      |     ~
Language: C++

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

int main(){
  int 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:8: error: invalid types 'int[int]' for array subscript
    9 |   if (s[0] == '1')++counter;
      |        ^
a.cc:10:8: error: invalid types 'int[int]' for array subscript
   10 |   if (s[1] == '1')++counter;
      |        ^
a.cc:11:8: error: invalid types 'int[int]' for array subscript
   11 |   if (s[2] == '1')++counter;
      |        ^
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 入力
		String a = sc.next();
       	// 1の場合、加算
      	int b = 0;
      	if (a.subStiring(0,1).equals("1")){
        b += 1;
        }
      	if (a.subStiring(1,2).equals("1")){
        b += 1;
        }
      	if (a.subStiring(2,3).equals("1")){
        b += 1;
        }
		System.out.println(b);
	}
}

Compiler output:
Main.java:9: error: cannot find symbol
      	if (a.subStiring(0,1).equals("1")){
      	     ^
  symbol:   method subStiring(int,int)
  location: variable a of type String
Main.java:12: error: cannot find symbol
      	if (a.subStiring(1,2).equals("1")){
      	     ^
  symbol:   method subStiring(int,int)
  location: variable a of type String
Main.java:15: error: cannot find symbol
      	if (a.subStiring(2,3).equals("1")){
      	     ^
  symbol:   method subStiring(int,int)
  location: variable a of type String
3 errors
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 入力
		String a = sc.next();
       	// 1の場合、加算
      	int b = 0;
      	if (a.subStiring(0,1).equals"1"){
        b += 1;
        }
      	if (a.subStiring(1,2).equals"1"){
        b += 1;
        }
      	if (a.subStiring(2,3).equals"1"){
        b += 1;
        }
		System.out.println(b);
	}
}

Compiler output:
Main.java:9: error: ')' expected
      	if (a.subStiring(0,1).equals"1"){
      	                            ^
Main.java:9: error: ';' expected
      	if (a.subStiring(0,1).equals"1"){
      	                               ^
Main.java:12: error: ')' expected
      	if (a.subStiring(1,2).equals"1"){
      	                            ^
Main.java:12: error: ';' expected
      	if (a.subStiring(1,2).equals"1"){
      	                               ^
Main.java:15: error: ')' expected
      	if (a.subStiring(2,3).equals"1"){
      	                            ^
Main.java:15: error: ';' expected
      	if (a.subStiring(2,3).equals"1"){
      	                               ^
6 errors
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 入力
		String a = sc.next();
       	// int型にキャスト
      	int b = Integer.parseInt(a.subStiring(0,1));
      	int c = Integer.parseInt(a.subStiring(1,2));
      	int d = Integer.parseInt(a.subStiring(2,3));
      	int e = b + c + d;
      	switch (d){
          case 0:
			System.out.println(0);
      		break;
          case 1:
			System.out.println(1);
      		break;
          case 2:
			System.out.println(2);
      		break;
        }
	}
}


Compiler output:
Main.java:8: error: cannot find symbol
      	int b = Integer.parseInt(a.subStiring(0,1));
      	                          ^
  symbol:   method subStiring(int,int)
  location: variable a of type String
Main.java:9: error: cannot find symbol
      	int c = Integer.parseInt(a.subStiring(1,2));
      	                          ^
  symbol:   method subStiring(int,int)
  location: variable a of type String
Main.java:10: error: cannot find symbol
      	int d = Integer.parseInt(a.subStiring(2,3));
      	                          ^
  symbol:   method subStiring(int,int)
  location: variable a of type String
3 errors
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		// スペース区切りの整数の入力
		int b = sc.nextInt();
		int c = sc.nextInt();
      	int d = a + b + c;
      	switch d
          case 0:
			System.out.println(0);
      		break;
          case 1:
			System.out.println(1);
      		break;
          case 2:
			System.out.println(2);
      		break;
	}
}

Compiler output:
Main.java:11: error: '(' expected
      	switch d
      	      ^
Main.java:11: error: ')' expected
      	switch d
      	        ^
Main.java:22: error: reached end of file while parsing
}
 ^
3 errors
Language: Java

import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    final Main application = new Main();
    application.run();
  }
  public void run() {
    final Places places = this.scanFromStdin();
    final int marbleCount = new MarbleCounter().count(places);
    printMarbleCount(marbleCount);
  }
  Places scanFromStdin() {
    final Scanner scanner = new Scanner(System.in);
    final String placesString = scanner.next();
    final boolean firstPlace = placesString.cheAt(0) == '1';
    final boolean secondPlace = placesString.cheAt(1) == '1';
    final boolean thirdPlace = placesString.cheAt(2) == '1';
    return new Places(firstPlace, secondPlace, thirdPlace);
  }
  void printMarbleCount(int count) {
    System.out.println(count);
  }
}
class Places {
  public final boolean firstPlace;
  public final boolean secondPlace;
  public final boolean thirdPlace;
  public Places(boolean firstPlace, boolean secondPlace, boolean thirdPlace) {
    this.firstPlace = firstPlace;
    this.secondPlace = secondPlace;
    this.thirdPlace = thirdPlace;
  }
}
class MarbleCounter {
  public int count(Places places) {
    int count = 0;
    if (places.firstPlace) {
      count++;
    }
    if (places.secondPlace) {
      count++;
    }
    if (places.thirdPlace) {
       count++;
    }
    return count;
  }
}


Compiler output:
Main.java:16: error: cannot find symbol
    final boolean firstPlace = placesString.cheAt(0) == '1';
                                           ^
  symbol:   method cheAt(int)
  location: variable placesString of type String
Main.java:17: error: cannot find symbol
    final boolean secondPlace = placesString.cheAt(1) == '1';
                                            ^
  symbol:   method cheAt(int)
  location: variable placesString of type String
Main.java:18: error: cannot find symbol
    final boolean thirdPlace = placesString.cheAt(2) == '1';
                                           ^
  symbol:   method cheAt(int)
  location: variable placesString of type String
3 errors
Language: Java

import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    final Main application = new Main();
    application.run();
  }
  public void run() {
    final Places places = this.scanFromStdin();
    final int marbleCount = new MarbleCounter().count(places);
    printMarbleCount(marbleCount);
  }
  Places scanFromStdin() {
    final Scanner scanner = new Scanner(System.in);
    final String placesString = scanner.readLine();
    final boolean firstPlace = placesString.cheAt(0) == '1';
    final boolean secondPlace = placesString.cheAt(1) == '1';
    final boolean thirdPlace = placesString.cheAt(2) == '1';
    return new Places(firstPlace, secondPlace, thirdPlace);
  }
  void printMarbleCount(int count) {
    System.out.println(count);
  }
}
class Places {
  public final boolean firstPlace;
  public final boolean secondPlace;
  public final boolean thirdPlace;
  public Places(boolean firstPlace, boolean secondPlace, boolean thirdPlace) {
    this.firstPlace = firstPlace;
    this.secondPlace = secondPlace;
    this.thirdPlace = thirdPlace;
  }
}
class MarbleCounter {
  public int count(Places places) {
    int count = 0;
    if (places.firstPlace) {
      count++;
    }
    if (places.secondPlace) {
      count++;
    }
    if (places.thirdPlace) {
       count++;
    }
    return count;
  }
}


Compiler output:
Main.java:15: error: cannot find symbol
    final String placesString = scanner.readLine();
                                       ^
  symbol:   method readLine()
  location: variable scanner of type Scanner
Main.java:16: error: cannot find symbol
    final boolean firstPlace = placesString.cheAt(0) == '1';
                                           ^
  symbol:   method cheAt(int)
  location: variable placesString of type String
Main.java:17: error: cannot find symbol
    final boolean secondPlace = placesString.cheAt(1) == '1';
                                            ^
  symbol:   method cheAt(int)
  location: variable placesString of type String
Main.java:18: error: cannot find symbol
    final boolean thirdPlace = placesString.cheAt(2) == '1';
                                           ^
  symbol:   method cheAt(int)
  location: variable placesString of type String
4 errors
Language: Java

import java.util;

public class Main {
  public static void main(String[] args) {
    final Main application = new Main();
    application.run();
  }
  public void run() {
    final Places places = this.scanFromStdin();
    final int marbleCount = new MarbleCounter().count(places);
    printMarbleCount(marbleCount);
  }
  Places scanFromStdin() {
    final Scanner scanner = new Scanner(System.in);
    final String placesString = scanner.readLine();
    final boolean firstPlace = placesString.cheAt(0) == '1';
    final boolean secondPlace = placesString.cheAt(1) == '1';
    final boolean thirdPlace = placesString.cheAt(2) == '1';
    return new Places(firstPlace, secondPlace, thirdPlace);
  }
  void printMarbleCount(int count) {
    System.out.println(count);
  }
}
class Places {
  public final boolean firstPlace;
  public final boolean secondPlace;
  public final boolean thirdPlace;
  public Places(boolean firstPlace, boolean secondPlace, boolean thirdPlace) {
    this.firstPlace = firstPlace;
    this.secondPlace = secondPlace;
    this.thirdPlace = thirdPlace;
  }
}
class MarbleCounter {
  public int count(Places places) {
    int count = 0;
    if (places.firstPlace) {
      count++;
    }
    if (places.secondPlace) {
      count++;
    }
    if (places.thirdPlace) {
       count++;
    }
    return count;
  }
}


Compiler output:
Main.java:1: error: cannot find symbol
import java.util;
           ^
  symbol:   class util
  location: package java
Main.java:14: error: cannot find symbol
    final Scanner scanner = new Scanner(System.in);
          ^
  symbol:   class Scanner
  location: class Main
Main.java:14: error: cannot find symbol
    final Scanner scanner = new Scanner(System.in);
                                ^
  symbol:   class Scanner
  location: class Main
Main.java:16: error: cannot find symbol
    final boolean firstPlace = placesString.cheAt(0) == '1';
                                           ^
  symbol:   method cheAt(int)
  location: variable placesString of type String
Main.java:17: error: cannot find symbol
    final boolean secondPlace = placesString.cheAt(1) == '1';
                                            ^
  symbol:   method cheAt(int)
  location: variable placesString of type String
Main.java:18: error: cannot find symbol
    final boolean thirdPlace = placesString.cheAt(2) == '1';
                                           ^
  symbol:   method cheAt(int)
  location: variable placesString of type String
6 errors
Language: Java

public class Main {
  public static void main(String[] args) {
    final Main application = new Main();
    application.run();
  }
  public void run() {
    final Places places = this.scanFromStdin();
    final int marbleCount = new MarbleCounter().count(places);
    printMarbleCount(marbleCount);
  }
  Places scanFromStdin() {
    final Scanner scanner = new Scanner(System.in);
    final String placesString = scanner.readLine();
    final boolean firstPlace = placesString.cheAt(0) == '1';
    final boolean secondPlace = placesString.cheAt(1) == '1';
    final boolean thirdPlace = placesString.cheAt(2) == '1';
    return new Places(firstPlace, secondPlace, thirdPlace);
  }
  void printMarbleCount(int count) {
    System.out.println(count);
  }
}
class Places {
  public final boolean firstPlace;
  public final boolean secondPlace;
  public final boolean thirdPlace;
  public Places(boolean firstPlace, boolean secondPlace, boolean thirdPlace) {
    this.firstPlace = firstPlace;
    this.secondPlace = secondPlace;
    this.thirdPlace = thirdPlace;
  }
}
class MarbleCounter {
  public int count(Places places) {
    int count = 0;
    if (places.firstPlace) {
      count++;
    }
    if (places.secondPlace) {
      count++;
    }
    if (places.thirdPlace) {
       count++;
    }
    return count;
  }
}


Compiler output:
Main.java:12: error: cannot find symbol
    final Scanner scanner = new Scanner(System.in);
          ^
  symbol:   class Scanner
  location: class Main
Main.java:12: error: cannot find symbol
    final Scanner scanner = new Scanner(System.in);
                                ^
  symbol:   class Scanner
  location: class Main
Main.java:14: error: cannot find symbol
    final boolean firstPlace = placesString.cheAt(0) == '1';
                                           ^
  symbol:   method cheAt(int)
  location: variable placesString of type String
Main.java:15: error: cannot find symbol
    final boolean secondPlace = placesString.cheAt(1) == '1';
                                            ^
  symbol:   method cheAt(int)
  location: variable placesString of type String
Main.java:16: error: cannot find symbol
    final boolean thirdPlace = placesString.cheAt(2) == '1';
                                           ^
  symbol:   method cheAt(int)
  location: variable placesString of type String
5 errors
Language: Java

public class Main {
  public static void main(String[] args) {
    final Main application = new Main();
    application.run();
  }
  public void run() {
    final Places places = this.scanDromStdin();
    final int marbleCount = new MarbleCounter().count(places);
    printMarbleCount(marbleCount);
  }
  Places scanFromStdin() {
    final Scanner scanner = new Scanner(System.in);
    final String placesString = scanner.readLine();
    final boolean firstPlace = placesString.cheAt(0) == '1';
    final boolean secondPlace = placesString.cheAt(1) == '1';
    final boolean thirdPlace = placesString.cheAt(2) == '1';
    return new Places(firstPlace, secondPlace, thirdPlace);
  }
  void printMarbleCount(int count) {
    System.out.println(count);
  }
}
class Places {
  public final boolean firstPlace;
  public final boolean secondPlace;
  public final boolean thirdPlace;
  public Places(boolean firstPlace, boolean secondPlace, boolean thirdPlace) {
    this.firstPlace = firstPlace;
    this.secondPlace = secondPlace;
    this.thirdPlace = thirdPlace;
  }
}
class MarbleCounter {
  public int count(Places places) {
    int count = 0;
    if (places.firstPlace) {
      count++;
    }
    if (places.secondPlace) {
      count++;
    }
    if (places.thirdPlace) {
       count++;
    }
    return count;
  }
}


Compiler output:
Main.java:7: error: cannot find symbol
    final Places places = this.scanDromStdin();
                              ^
  symbol: method scanDromStdin()
Main.java:12: error: cannot find symbol
    final Scanner scanner = new Scanner(System.in);
          ^
  symbol:   class Scanner
  location: class Main
Main.java:12: error: cannot find symbol
    final Scanner scanner = new Scanner(System.in);
                                ^
  symbol:   class Scanner
  location: class Main
Main.java:14: error: cannot find symbol
    final boolean firstPlace = placesString.cheAt(0) == '1';
                                           ^
  symbol:   method cheAt(int)
  location: variable placesString of type String
Main.java:15: error: cannot find symbol
    final boolean secondPlace = placesString.cheAt(1) == '1';
                                            ^
  symbol:   method cheAt(int)
  location: variable placesString of type String
Main.java:16: error: cannot find symbol
    final boolean thirdPlace = placesString.cheAt(2) == '1';
                                           ^
  symbol:   method cheAt(int)
  location: variable placesString of type String
6 errors
Language: C++

#include <iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: invalid types 'int[int]' for array subscript
    7 |         cout << s[0] + s[1] + s[2] << endl;
      |                  ^
a.cc:7:25: error: invalid types 'int[int]' for array subscript
    7 |         cout << s[0] + s[1] + s[2] << endl;
      |                         ^
a.cc:7:32: error: invalid types 'int[int]' for array subscript
    7 |         cout << s[0] + s[1] + s[2] << endl;
      |                                ^
Language: C++

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


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

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

int main() {
  int A;
  cin >> A;
  if(A==000){
    cout << 0 << endl;
  }
  else if(A%3=1){
    cout << 1 << endl;
  }
  else if(A%3=2){
    cout << 2 << endl;
  }
  else {
    cout << 3 << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: lvalue required as left operand of assignment
   10 |   else if(A%3=1){
      |           ~^~
a.cc:13:12: error: lvalue required as left operand of assignment
   13 |   else if(A%3=2){
      |           ~^~
Language: C++

#include<iostream>
int main(){
    int s1,s2,s3;
    std::cin >> s1 >> s2 >> s3;
    std::cout s1 + s2 + s3;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:14: error: expected ';' before 's1'
    5 |     std::cout s1 + s2 + s3;
      |              ^~~
      |              ;
Language: C++

int main() {
  string s;
  int c = 0;
  cin >> s;
  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:2:3: error: 'string' was not declared in this scope
    2 |   string s;
      |   ^~~~~~
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin >> s;
      |   ^~~
a.cc:4:10: error: 's' was not declared in this scope
    4 |   cin >> s;
      |          ^
a.cc:8:3: error: 'cout' was not declared in this scope
    8 |   cout << c << endl;
      |   ^~~~
a.cc:8:16: error: 'endl' was not declared in this scope
    8 |   cout << c << endl;
      |                ^~~~
Language: C++

int main() {
  string s;
  int c = 0;
  cin >> s;
  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:2:3: error: 'string' was not declared in this scope
    2 |   string s;
      |   ^~~~~~
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin >> s;
      |   ^~~
a.cc:4:10: error: 's' was not declared in this scope
    4 |   cin >> s;
      |          ^
a.cc:8:3: error: 'cout' was not declared in this scope
    8 |   cout << c << endl;
      |   ^~~~
a.cc:8:16: error: 'endl' was not declared in this scope
    8 |   cout << c << endl;
      |                ^~~~
Language: Java

import java.util.ArrayList;
import java.util.Scanner;
import java.util.stream.Collectors;

/**
 * すぬけ君は1,2,3の番号がついた3つのマスからなるマス目を持っています。
 * 各マスには 0 か 1 が書かれており、マスiにはs iが書かれています。
 *
 * すぬけ君は 1 が書かれたマスにビー玉を置きます。
 * ビー玉が置かれるマスがいくつあるか求めてください。
 *
 * # restrict
 * s1, s2, s3 は、'0', '1'
 *
 * # input
 * 入力は以下の形式で標準入力から与えられる。
 * s1s2s3
 *
 * #
 */
public class Main {
    public static void main(String[] args) {
        final Scanner s = new Scanner(System.in);

        String s1 = s.next();
        String s2 = s.next();
        String s3 = s.next();

        ArrayList<String> list = new ArrayList<String>()
        list.add(s1);
        list.add(s2);
        list.add(s3);

        int count = list.stream()
                .filter( str -> str.equals("1"))
                .collect(Collectors.toList())
                .size();

        System.out.print(count);
    }
}


Compiler output:
Main.java:29: error: ';' expected
        ArrayList<String> list = new ArrayList<String>()
                                                        ^
1 error
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: expected ';' before '}' token
    9 |   if(s[0]==1){ans++}
      |                    ^
      |                    ;
a.cc:10:20: error: expected ';' before '}' token
   10 |   if(s[1]==1){ans++}
      |                    ^
      |                    ;
a.cc:11:18: error: expected identifier before '++' token
   11 |   if(s[2]==1){and++}
      |                  ^~
Language: C++

#include<iostream>
#include<string>

using namespace std;

int main(){
	string s;
  int counter = 0;
  cin >> s;
  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:10:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |   if(s[0] == "1") counter++;
a.cc:11:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |   if(s[1] == "1") counter++;
a.cc:12:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   if(s[2] == "1") counter++;
Language: C++

#include <iostream>
#include <string>
 
using namespace std;
 
int main(){
  string s;
  cin >> s;
  int count = 0;
  
  if(string[0] == '1'){count++;}
  if(string[1] == '1'){count++;}
  if(string[2] == '1'){count++;}
  
  cout << count << endl;
  return 0;
}
#include <iostream>
#inclide <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;
  return 0;
}


Compiler output:
a.cc:19:2: error: invalid preprocessing directive #inclide; did you mean #include?
   19 | #inclide <string>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:11:12: error: expected unqualified-id before '[' token
   11 |   if(string[0] == '1'){count++;}
      |            ^
a.cc:12:12: error: expected unqualified-id before '[' token
   12 |   if(string[1] == '1'){count++;}
      |            ^
a.cc:13:12: error: expected unqualified-id before '[' token
   13 |   if(string[2] == '1'){count++;}
      |            ^
a.cc: At global scope:
a.cc:23:5: error: redefinition of 'int main()'
   23 | int main(){
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main(){
      |     ^~~~
Language: C++

#include <iostream>
#inclide <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;
  return 0;
}


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

#include <iostream>
#inclide <string>
 
using namespace std;
 
int main(){
  string s;
  cin >> s;
  int count = 0;
  
  if(string[0] == '1'){count++;}
  if(string[1] == '1'){count++;}
  if(string[2] == '1'){count++;}
  
  cout << count << endl;
  return 0;
}
#include <iostream>
#inclide <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;
  return 0;
}


Compiler output:
a.cc:2:2: error: invalid preprocessing directive #inclide; did you mean #include?
    2 | #inclide <string>
      |  ^~~~~~~
      |  include
a.cc:19:2: error: invalid preprocessing directive #inclide; did you mean #include?
   19 | #inclide <string>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:11:12: error: expected unqualified-id before '[' token
   11 |   if(string[0] == '1'){count++;}
      |            ^
a.cc:12:12: error: expected unqualified-id before '[' token
   12 |   if(string[1] == '1'){count++;}
      |            ^
a.cc:13:12: error: expected unqualified-id before '[' token
   13 |   if(string[2] == '1'){count++;}
      |            ^
a.cc: At global scope:
a.cc:23:5: error: redefinition of 'int main()'
   23 | int main(){
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main(){
      |     ^~~~
Language: C++

#include <iostream>
#inclide <string>

using namespace std;

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

Compiler output:
a.cc:2:2: error: invalid preprocessing directive #inclide; did you mean #include?
    2 | #inclide <string>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:11:12: error: expected unqualified-id before '[' token
   11 |   if(string[0] == '1'){count++;}
      |            ^
a.cc:12:12: error: expected unqualified-id before '[' token
   12 |   if(string[1] == '1'){count++;}
      |            ^
a.cc:13:12: error: expected unqualified-id before '[' token
   13 |   if(string[2] == '1'){count++;}
      |            ^