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

#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
using namespace std;
int main() {
	string s;
	cin >> s;
	int ans = 0;
	int i = 0;
	while (i < 3) {
		if (s[i] == "1")
			ans++;
		i++;
	}
	cout << ans << "\n";
}

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

#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
using namespace std;
int main() {
	string s;
	cin >> s;
	int ans = 0;
	int i = 0;
	do (i < 3); {
		if (s[i] == "1")
			ans++;
		i++;
	}
	cout << ans << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: expected 'while' before '{' token
   11 |         do (i < 3); {
      |                     ^
a.cc:11:21: error: expected '(' before '{' token
   11 |         do (i < 3); {
      |                     ^
      |                     (
a.cc:11:21: error: expected primary-expression before '{' token
a.cc:11:20: error: expected ')' before '{' token
   11 |         do (i < 3); {
      |                    ^~
      |                    )
a.cc:11:20: error: expected ';' before '{' token
   11 |         do (i < 3); {
      |                    ^~
      |                    ;
a.cc:12:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |                 if (s[i] == "1")
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
using namespace std;
int main() {
	string s;
	cin >> s;
	int ans = 0;
	int i = 0;
	do (i < 3) {
		if (s[i] == "1")
			ans++;
		i++;
	}
	cout << ans << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: expected ';' before '{' token
   11 |         do (i < 3) {
      |                   ^~
      |                   ;
a.cc:16:9: error: expected 'while' before 'cout'
   16 |         cout << ans << "\n";
      |         ^~~~
a.cc:16:9: error: expected '(' before 'cout'
   16 |         cout << ans << "\n";
      |         ^~~~
      |         (
a.cc:16:28: error: expected ')' before ';' token
   16 |         cout << ans << "\n";
      |         ~~~~               ^
      |                            )
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
using namespace std;
int main() {
	string s;
	cin >> s;
	int ans = 0;
	int i = 0;
	do (i < 3) {
		if (s[i] == 1)
			ans++;
		i++;
	}
	cout << ans << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: expected ';' before '{' token
   11 |         do (i < 3) {
      |                   ^~
      |                   ;
a.cc:16:9: error: expected 'while' before 'cout'
   16 |         cout << ans << "\n";
      |         ^~~~
a.cc:16:9: error: expected '(' before 'cout'
   16 |         cout << ans << "\n";
      |         ^~~~
      |         (
a.cc:16:28: error: expected ')' before ';' token
   16 |         cout << ans << "\n";
      |         ~~~~               ^
      |                            )
Language: C++

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
  int a;
  cin>>a;
  int b=a/100;
  int c=(a%100)/10;
  int d=(a%100)%10;
  if(b==1&&c==1&&d=1){
    cout<<3<<endl;
  }else if((b==0&&c==1&&d==1)||(b==1&&c==0&&d==1)||(b==1&&c==1&&d==0)){
    cout<<2<<endl;
  }else if((b==1&&c==0&&d==0)||(b==0&&c==1&&d==0)||(b==0&&c==0&&d==1)){
    cout<<1<<endl;
  }else{
    cout<<0<<endl;
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: lvalue required as left operand of assignment
   10 |   if(b==1&&c==1&&d=1){
      |      ~~~~~~~~~~^~~
Language: C++

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

int main() {
  double a;
  cin>>a;
  
  int x,y,z;
  
  x=a/100;
  
  y=(a-100*x)/10;
  
  z=a-100*x-10*y;
  
  cout<<x+y+z<<endl;
  
  
  
  cout<<s_1+s_2+s_3<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 's_1' was not declared in this scope
   20 |   cout<<s_1+s_2+s_3<<endl;
      |         ^~~
a.cc:20:13: error: 's_2' was not declared in this scope
   20 |   cout<<s_1+s_2+s_3<<endl;
      |             ^~~
a.cc:20:17: error: 's_3' was not declared in this scope
   20 |   cout<<s_1+s_2+s_3<<endl;
      |                 ^~~
Language: C++

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

int main() {
  int s_1 s_2 s_3;
  
  cin>>s_1>>s_2>>s_3;
  
  cout<<s_1+s_2+s_3<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: expected initializer before 's_2'
    5 |   int s_1 s_2 s_3;
      |           ^~~
a.cc:7:8: error: 's_1' was not declared in this scope
    7 |   cin>>s_1>>s_2>>s_3;
      |        ^~~
a.cc:7:13: error: 's_2' was not declared in this scope
    7 |   cin>>s_1>>s_2>>s_3;
      |             ^~~
a.cc:7:18: error: 's_3' was not declared in this scope
    7 |   cin>>s_1>>s_2>>s_3;
      |                  ^~~
Language: Java

import java.util.*;
 
public class Main{
	public static void main(String[] args){
	Scanner scanner = new Scanner(System.in);
      int n = scanner.nextInt();
      
      List<Integer> list = new ArrayList<>();
      
      for (int i = 0; i < n ; i++){
      	int b = scanner.nextInt();
        list.add(b);
      }
      
      int count = 0;
      Boolean result;
      
      for(int i = 0; i < 999999 ; i++){
        if(results){
        	break;
        }
        if(i != 0){
            count += 1;
        }
          for(int j = 0; j < list.get(i) ; j++ ){
            if(list.get(j) % 2 != 0){
              results = true;
              break;
            }else{
              split.set(j,list.get(i) / 2);
            }
        }
      }
     System.out.println(count);
    }
}
import java.util.*;
 
public class Main{
	public static void main(String[] args){
	Scanner scanner = new Scanner(System.in);
      int n = scanner.nextInt();
      
      List<Integer> list = new ArrayList<>();
      
      for (int i = 0; i < n ; i++){
      	int b = scanner.nextInt();
        list.add(b);
      }
      
      int count = 0;
      Boolean results;
      
      for(int i = 0; i < 999999 ; i++){
        if(results){
        	break;
        }
        if(i != 0){
            count += 1;
        }
          for(int j = 0; j < list.get(i) ; j++ ){
            if(list.get(j) % 2 != 0){
              results = true;
              break;
            }else{
              list.set(j,list.get(i) / 2);
            }
        }
      }
     System.out.println(count);
    }
}



Compiler output:
Main.java:37: error: class, interface, enum, or record expected
import java.util.*;
^
1 error
Language: Java

import java.util.*;
 
public class Main{
	public static void main(String[] args){
	Scanner scanner = new Scanner(System.in);
      int n = scanner.nextInt();
      
      List<Integer> list = new ArrayList<>();
      
      for (int i = 0; i < n ; i++){
      	int b = scanner.nextInt();
        list.add(b);
      }
      
      int count = 0;
      Boolean result;
      
      for(int i = 0; i < 999999 ; i++){
        if(results){
        	break;
        }
        if(i != 0){
            count += 1;
        }
          for(int j = 0; j < list.get(i) ; j++ ){
            if(list.get(j) % 2 != 0){
              results = true;
              break;
            }else{
              split.set(j,list.get(i) / 2);
            }
        }
      }
     System.out.println(count);
    }
}

Compiler output:
Main.java:19: error: cannot find symbol
        if(results){
           ^
  symbol:   variable results
  location: class Main
Main.java:27: error: cannot find symbol
              results = true;
              ^
  symbol:   variable results
  location: class Main
Main.java:30: error: cannot find symbol
              split.set(j,list.get(i) / 2);
              ^
  symbol:   variable split
  location: class Main
3 errors
Language: Java

import java.util.*;
 
public class Main{
	public static void main(String[] args){
	Scanner scanner = new Scanner(System.in);
      int a = scanner.nextint();
      String b = scanner.next();
      
      List<String> split = Arrays.asList(b.split(" "));
      
      int count = 0;
      String results = "";
      
      for(int i = 0; i < 999999 ; i++){
        if(results.equals("n")){
        	break;
        }
        if(i != 0){
            count += 1;
        }
          for(int j = 0; j < a ; j++ ){
            if(Integer.parseInt(split.get(j)) % 2 != 0){
 
              results = "n";
              break;
            }else{
              split.set(j,String.valueOf(Integer.parseInt(split.get(j)) / 2));
            }
        }
      }
     System.out.println(count);
    }
}

Compiler output:
Main.java:6: error: cannot find symbol
      int a = scanner.nextint();
                     ^
  symbol:   method nextint()
  location: variable scanner of type Scanner
1 error
Language: Java

import java.util.*;
 
public class Main {
	public static void main(String[] args) {
    	Scanner scanner = new Scanner(System.in);
        	String a = scanner.next();
          	List<String> split = Arrays.asList(a.split(""));
            
            int count = 0;
            for(int i = 0; i<3; i++){
            	if(split.get(i) == "1"){
                	count += 1;
                }
            }    
        System.out.println(count); 
        }
}
import java.util.Scanner;
import java.util.ArrayList;
import java.util.List;
 
public class Main {
	public static void main(String[] args) {
    	Scanner scanner = new Scanner(System.in);
        	String a = scanner.next();
          	List<String> split = Arrays.asList(a.split(""));
            
            int count = 0;
            for(int i = 0; i<3; i++){
            	if(split.get(i) == "1"){
                	count += 1;
                }
            }    
        System.out.println(count); 
        }
}


Compiler output:
Main.java:18: error: class, interface, enum, or record expected
import java.util.Scanner;
^
Main.java:19: error: class, interface, enum, or record expected
import java.util.ArrayList;
^
Main.java:20: error: class, interface, enum, or record expected
import java.util.List;
^
3 errors
Language: Java

import java.util.Scanner;
import java.util.ArrayList;
import java.util.List;
 
public class Main {
	public static void main(String[] args) {
    	Scanner scanner = new Scanner(System.in);
        	String a = scanner.next();
          	List<String> split = Arrays.asList(a.split(""));
            
            int count = 0;
            for(int i = 0; i<3; i++){
            	if(split.get(i) == "1"){
                	count += 1;
                }
            }    
        System.out.println(count); 
        }
}

Compiler output:
Main.java:9: error: cannot find symbol
          	List<String> split = Arrays.asList(a.split(""));
          	                     ^
  symbol:   variable Arrays
  location: class Main
1 error
Language: Java

import java.util.Scanner;
import java.util.ArrayList;
import java.util.List;
 
public class Main {
	public static void main(String[] args) {
    	Scanner scanner = new Scanner(System.in);
        	int a = scanner.nextInt();
          	List<int> split = Arrays.asList(a.split(""));
            
            int count = 0;
            for(int i = 0; i<3; i++){
            	if(split.get(i) == 1){
                	count += 1;
                }
            }    
      	
        System.out.println(count);
      
        }
}

Compiler output:
Main.java:9: error: unexpected type
          	List<int> split = Arrays.asList(a.split(""));
          	     ^
  required: reference
  found:    int
Main.java:9: error: cannot find symbol
          	List<int> split = Arrays.asList(a.split(""));
          	                  ^
  symbol:   variable Arrays
  location: class Main
Main.java:9: error: int cannot be dereferenced
          	List<int> split = Arrays.asList(a.split(""));
          	                                 ^
3 errors
Language: Java

import java.util.Scanner;
import java.util.ArrayList;
import java.util.List;

public class Mian {
	public static void main(String[] args) {
    	Scanner scanner = new Scanner(System.in);
        	int a = scanner.nextInt();
          	List<int> split = Arrays.asList(a.split(""));
            
            int count = ;0
            for(int i = 0; i<3; i++){
            	if(split.get(i) == 1){
                	count += 1;
                }
            }    
      	
        System.out.println(count);
      
        }
}

Compiler output:
Main.java:11: error: illegal start of expression
            int count = ;0
                        ^
Main.java:11: error: not a statement
            int count = ;0
                         ^
Main.java:11: error: ';' expected
            int count = ;0
                          ^
3 errors
Language: Java

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String a = sc.next();
      	int count = 0;
      	for(int i = 0 ; i < 3 ; i++){
         if(a.substring(i,1) == "1"{
  			count += 1;       
         }
        }          
            System.out.print(count);
    }
}



Compiler output:
Main.java:9: error: ')' expected
         if(a.substring(i,1) == "1"{
                                   ^
1 error
Language: Java

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String a = sc.next();
      	int count = 0;
      	for(int i = 0 ; i < 3 ; i++){
         if(a.substring(i,1) == "1"{
  			count += 1;       
         }
        }          
            System.out.println(count);
    }
}



Compiler output:
Main.java:9: error: ')' expected
         if(a.substring(i,1) == "1"{
                                   ^
1 error
Language: C

#include<stdio.h>
int main(void)
{
  int a;
  int b;
  int c;
 scanf("%d",&a);
 scanf("%d",&b);
 scanf("%d",&c);
 printf("%d",a+b+c)
   return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:20: error: expected ';' before 'return'
   10 |  printf("%d",a+b+c)
      |                    ^
      |                    ;
   11 |    return 0;
      |    ~~~~~~
Language: C

#include<studio.h>
int main(void)
{
  int a;
  int b;
  int c;
 scanf("%d",&a);
 scanf("%d",&b);
 scanf("%d",&c);
 printf("%d",a*b*c)
   return 0;
}


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

#include<stdio.h>
 int main(void)
 {
   int a;
   int b;
   int c;
   
   scanf("%d%d%d",&a,%b,&c);
   printf("%d",a*b*c);
   
   return 0;
 }


Compiler output:
main.c: In function 'main':
main.c:8:22: error: expected expression before '%' token
    8 |    scanf("%d%d%d",&a,%b,&c);
      |                      ^
Language: C

#include<stdio.h>
 int main(void)
 {
   int a;
   int b;
   int c;
   
   scanf("%d%d%d",&a&b&c);
   printf("%d",a*b*c);
   
   return 0;
 }


Compiler output:
main.c: In function 'main':
main.c:8:21: error: invalid operands to binary & (have 'int *' and 'int')
    8 |    scanf("%d%d%d",&a&b&c);
      |                   ~~^
      |                   |
      |                   int *
Language: C

#include<stdio.h>
 int main(void)
 {
   int a;
   int b;
   int c;
   
   scanf("%d%d%d",&a%b&c);
   printf("%d",a*b*c);
   
   return 0;
 }


Compiler output:
main.c: In function 'main':
main.c:8:21: error: invalid operands to binary % (have 'int *' and 'int')
    8 |    scanf("%d%d%d",&a%b&c);
      |                   ~~^
      |                   |
      |                   int *
Language: C

#include<stdio.h>
 int main(void)
 {
   int a;
   int b;
   int c;
   
   scanf("%d%d%d",&a,&b,&c);
   printf("%d",a*b:c);
   
   return 0;
 }

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

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

int main(void) {
  stirng s;
  cin >> s;
  
  int n = 0;
  
  for(int i = 0; i < s.size(); i++) {
    if (s[i] == '1') {
      n += 1;
    } else {
      continue;
    }
  }
  cout << n << endl;
  return 0;
}


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: expected unqualified-id before '=' token
    5 |   string = s;
      |          ^
a.cc:6:10: error: 's' was not declared in this scope
    6 |   cin >> s;
      |          ^
Language: C++

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

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

    

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:43: error: expected ';' before 'cout'
    9 |   x = a / 100 + a / 10 % 10 + a % 100 % 10
      |                                           ^
      |                                           ;
   10 |   cout << x << endl;
      |   ~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'cout'
    9 |   cout << x << endl;
      |   ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <set>

#include <regex>
#include <locale>
#include <iomanip>

using namespace std;
using ll = long long;

#define OVERLOAD3(_1,_2,_3,name,...) name
#define REP(i,n) REPI(i,0,n)
#define REPI(i,a,b) for(int i=int(a),i##_Len=int(b);i<i##_Len;++i)
#define rep(...) OVERLOAD3(__VA_ARGS__,REPI,REP,)(__VA_ARGS__)
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())

int main () {
  int n;
  cin >> n;
  cout << n/100 + (n%100)/10 + (n%100)%10) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:42: error: expected ';' before ')' token
   23 |   cout << n/100 + (n%100)/10 + (n%100)%10) << endl;
      |                                          ^
      |                                          ;
Language: C++

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

int main(){
    string m;
    cin >> m;
    int s1,s2,s3;
    int m[0],m[1],m[2];
    cout << m[0] + m[1] + m[2] << endl;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: conflicting declaration 'int m [0]'
    8 |     int m[0],m[1],m[2];
      |         ^
a.cc:5:12: note: previous declaration as 'std::string m'
    5 |     string m;
      |            ^
a.cc:8:14: error: conflicting declaration 'int m [1]'
    8 |     int m[0],m[1],m[2];
      |              ^
a.cc:5:12: note: previous declaration as 'std::string m'
    5 |     string m;
      |            ^
a.cc:8:19: error: conflicting declaration 'int m [2]'
    8 |     int m[0],m[1],m[2];
      |                   ^
a.cc:5:12: note: previous declaration as 'std::string m'
    5 |     string m;
      |            ^
Language: C++

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

int main(){
    string m;
    cin >> m;
    int s1,s2,s3;
    s1 = m[0];
    s2 = m[1];
    s3 = m[2];
    cout << s1 + s2 + s3 << endl;
    
}

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

int main(){
    int m;
    cin >> m;
    int s1,s2,s3;
    s1 = m / 100;
    s2 = (m-s1*100)/10;
    s3 = (m-s1*100-s2*10);
    cout << s1 + s2 + s3 << endl;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> m;
      |     ^~~
a.cc:8:5: error: 'cout' was not declared in this scope
    8 |     cout << s1 + s2 + s3 << endl;
      |     ^~~~
a.cc:8:29: error: 'endl' was not declared in this scope
    8 |     cout << s1 + s2 + s3 << endl;
      |                             ^~~~
Language: Java

import java.util.*;

public class Main{
    void solve(){
        Scanner scan = new Scanner(System.in);
        String s = scan.nextInt();
        int out = 0;
        for(int i = 0; i < s.length(); i++){
            if(s.charAt(i) == '1') out++;
        }
        System.out.println(out);
    }
    
    public static void main(String[] args){
        new Main().solve();
    }
}


Compiler output:
Main.java:6: error: incompatible types: int cannot be converted to String
        String s = scan.nextInt();
                               ^
1 error
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:8:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |     if (s[0] == "1") count++;
a.cc:9:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     if (s[1] == "1") count++;
a.cc:10:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if (s[2] == "1") count++;
Language: C++

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

int main() {
  // ここにプログラムを追記
  int a,;
  cin >> a 
  cout << (a - a%100)/100 + (a%100 - a%10)/10 + a%10 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: expected unqualified-id before ';' token
    6 |   int a,;
      |         ^
a.cc:7:11: error: expected ';' before 'cout'
    7 |   cin >> a
      |           ^
      |           ;
    8 |   cout << (a - a%100)/100 + (a%100 - a%10)/10 + a%10 << endl;
      |   ~~~~
Language: C++

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

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

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

int main(){
    int si;
    int count=0;

    for(int i=1;i<4;i++){
        int si=0;
        cin >> si;
        if(si==1){
            count += 1;
        }
    }
  
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin >> si;
      |         ^~~
a.cc:13:5: error: 'cout' was not declared in this scope; did you mean 'count'?
   13 |     cout << count << endl;
      |     ^~~~
      |     count
a.cc:13:22: error: 'endl' was not declared in this scope
   13 |     cout << count << endl;
      |                      ^~~~
Language: C++

int main(){
    int si;
    int count=0;

    for(int i=1;i<4;i++){
        int si=0;
        cin >> si;
        if(si==1){
            count += 1;
        }
    }
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin >> si;
      |         ^~~
a.cc:12:5: error: 'cout' was not declared in this scope; did you mean 'count'?
   12 |     cout << count << endl;
      |     ^~~~
      |     count
a.cc:12:22: error: 'endl' was not declared in this scope
   12 |     cout << count << endl;
      |                      ^~~~
Language: C++

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

int main() {
  int s;
  cin >> s;
  cout << s/100 + s%100/10 	+s%10 >>;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:41: error: expected primary-expression before ';' token
    7 |   cout << s/100 + s%100/10      +s%10 >>;
      |                                         ^
Language: C++

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

int main() {
  int s;
  cin >> s;
  cout << s/100 + s%100/10 	+s10 >>;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:34: error: 's10' was not declared in this scope
    7 |   cout << s/100 + s%100/10      +s10 >>;
      |                                  ^~~
a.cc:7:40: error: expected primary-expression before ';' token
    7 |   cout << s/100 + s%100/10      +s10 >>;
      |                                        ^
Language: C++

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

int main() {
  int s;
  cin >> s;
  cout << s/100 + s%100/10 	+s10;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:34: error: 's10' was not declared in this scope
    7 |   cout << s/100 + s%100/10      +s10;
      |                                  ^~~
Language: C++

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

int main() {
  int s;
  cin >> s;
  cout << s/100 + s%100/10 	+s10;
}


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | v#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'v' does not name a type
    1 | v#include <bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> s;
      |   ^~~
a.cc:7:3: error: 'cout' was not declared in this scope
    7 |   cout << s/100 + s%100/10      +s10;
      |   ^~~~
a.cc:7:34: error: 's10' was not declared in this scope
    7 |   cout << s/100 + s%100/10      +s10;
      |                                  ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int S1S2S3;
  cin>>S1S2S3;
  cout<<S1%2+S2%2+S3%2<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'S1' was not declared in this scope; did you mean 'y1'?
    6 |   cout<<S1%2+S2%2+S3%2<<endl;
      |         ^~
      |         y1
a.cc:6:14: error: 'S2' was not declared in this scope
    6 |   cout<<S1%2+S2%2+S3%2<<endl;
      |              ^~
a.cc:6:19: error: 'S3' was not declared in this scope
    6 |   cout<<S1%2+S2%2+S3%2<<endl;
      |                   ^~
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int s,s1,s2,s3;
  cin>>s;
  if(s==111||s==110||s==101||s==100)
    {
      s3=s%100;
      s2=(s/10)%10;
      s1=1; 
    }
  else if(||s==011||s==010)
    {
      s3=s%10;
      s2=1;
      s1=0; 
    }
  else if(s==s==001||s==000)
    {
      s3=s;
      s2=0;
      s1=0;
    }
      cout<<s1+s2+s3<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: expected primary-expression before '||' token
   14 |   else if(||s==011||s==010)
      |           ^~
Language: C++

#include(bits/stdc++.h)

using namespace std;

int main(){
	int inputNumber;
  	int count = 0;
  	cin >> inputNumber;
  
  	for (;inputNumber > 0; inputNumber /= 10) {
      	int single = inputNumber % 10;
    	if (single) {
        	count++;
        }
    }
  
  cout << count << endl;
}

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:8:9: error: 'cin' was not declared in this scope
    8 |         cin >> inputNumber;
      |         ^~~
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:17:3: error: 'cout' was not declared in this scope
   17 |   cout << count << endl;
      |   ^~~~
a.cc:17:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:17:20: error: 'endl' was not declared in this scope
   17 |   cout << count << endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #include(bits/stdc++.h)
Language: C++

#include(bits/stdc++.h)

using namespace std;

int main(){
	int inputNumber;
  	int count = 0;
  	cin >> inputNumber;
  
  	for (;inputNumber > 0; inputNumber /= 10) {
      	int single = inputNumber % 10
    	if (single) {
        	count++;
        }
    }
  
  cout << count << endl;
}

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:8:9: error: 'cin' was not declared in this scope
    8 |         cin >> inputNumber;
      |         ^~~
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:12:9: error: expected ',' or ';' before 'if'
   12 |         if (single) {
      |         ^~
a.cc:17:3: error: 'cout' was not declared in this scope
   17 |   cout << count << endl;
      |   ^~~~
a.cc:17:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:17:20: error: 'endl' was not declared in this scope
   17 |   cout << count << endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #include(bits/stdc++.h)
Language: C++

#include(bits/stdc++.h)

using namespace std;

int main(){
  
  int a,b,c;
  int s1,s2,s3;

  cin >> s1;
  cin >> s2;
  cin >> s3;
  
  if(s1 = 1){
    a=1;
  }
  else{
    a=0;
  }
  
  if(s2 = 1){
    b=1;
  }
  else{
    b=0;
  }
  
  if(s3 = 1){
    c=1;
  }
  else{
    c=0;
  }
  
  cout << a+b+c << endl;
}

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:10:3: error: 'cin' was not declared in this scope
   10 |   cin >> s1;
      |   ^~~
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:35:3: error: 'cout' was not declared in this scope
   35 |   cout << a+b+c << endl;
      |   ^~~~
a.cc:35:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:35:20: error: 'endl' was not declared in this scope
   35 |   cout << a+b+c << endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #include(bits/stdc++.h)
Language: C++

#include<iostream>
using namespace std;

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

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

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

int main() {
  int s1;
  int s2:
  int s3;
  cin >> s1 >> s2 >> s3;
  x = s1 + s2 + s3;
  cout << x << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: expected initializer before ':' token
    6 |   int s2:
      |         ^
a.cc:8:16: error: 's2' was not declared in this scope; did you mean 's1'?
    8 |   cin >> s1 >> s2 >> s3;
      |                ^~
      |                s1
a.cc:8:22: error: 's3' was not declared in this scope; did you mean 's1'?
    8 |   cin >> s1 >> s2 >> s3;
      |                      ^~
      |                      s1
a.cc:9:3: error: 'x' was not declared in this scope
    9 |   x = s1 + s2 + s3;
      |   ^
Language: C++

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

int main() {
  int a,b,c;
  cin >> a >> b >> c;
  int sum==0;
  if(a==1){
    sum++;
  }
  if(b==1){
    sum++;
  }
  if(c==1){
    sum++;
  }
  cout << sum << end;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: expected initializer before '==' token
    7 |   int sum==0;
      |          ^~
a.cc:9:5: error: 'sum' was not declared in this scope
    9 |     sum++;
      |     ^~~
a.cc:12:5: error: 'sum' was not declared in this scope
   12 |     sum++;
      |     ^~~
a.cc:15:5: error: 'sum' was not declared in this scope
   15 |     sum++;
      |     ^~~
a.cc:17:11: error: 'sum' was not declared in this scope
   17 |   cout << sum << end;
      |           ^~~
Language: C++

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

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


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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: expected ')' before ';' token
    8 |   s1=(S-S%1009/100;
      |      ~            ^
      |                   )
Language: C++

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

int main() { 
  int s1 , s2 ,s3;
  int s = 100 * s1 + 10 * s2 + s3;
  cin >> おちんちん;
  cout << おちんちん % 9 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: '\U0000304a\U00003061\U00003093\U00003061\U00003093' was not declared in this scope
    7 |   cin >> おちんちん;
      |          ^~~~~~~~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: 'C' was not declared in this scope
    9 |   cout << a%2+b%2+C%2+d%2 << endl;
      |                   ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: expected initializer before 'b'
    5 |   int a b c d;
      |         ^
a.cc:7:10: error: 'a' was not declared in this scope
    7 |   cin >> a >> b >> c >> d;
      |          ^
a.cc:7:15: error: 'b' was not declared in this scope
    7 |   cin >> a >> b >> c >> d;
      |               ^
a.cc:7:20: error: 'c' was not declared in this scope
    7 |   cin >> a >> b >> c >> d;
      |                    ^
a.cc:7:25: error: 'd' was not declared in this scope
    7 |   cin >> a >> b >> c >> d;
      |                         ^
a.cc:9:19: error: 'C' was not declared in this scope
    9 |   cout << a%2+b%2+C%2+d%2 << endl;
      |                   ^
Language: C++

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

int main() {
  // ここにプログラムを追記
  int a,b,c,d;
  cin >> a;
  b=a/100;
  c=a/10-10*b;
  d=a-100*b-10*c
  cout << (b+c+d)%9 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: expected ';' before 'cout'
   10 |   d=a-100*b-10*c
      |                 ^
      |                 ;
   11 |   cout << (b+c+d)%9 << endl;
      |   ~~~~
Language: C++

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

int main() { 
  cin >> s1 s2 s3;
  cout << ( s1 + s2 + s3 ) % 9 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: 's1' was not declared in this scope; did you mean 'y1'?
    5 |   cin >> s1 s2 s3;
      |          ^~
      |          y1
a.cc:6:18: error: 's2' was not declared in this scope
    6 |   cout << ( s1 + s2 + s3 ) % 9 << endl;
      |                  ^~
a.cc:6:23: error: 's3' was not declared in this scope
    6 |   cout << ( s1 + s2 + s3 ) % 9 << endl;
      |                       ^~
Language: C++

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

int main() {
  cin >> s1s2s3;
  cout << ( s1 + s2 + s3 ) % 9 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: 's1s2s3' was not declared in this scope
    5 |   cin >> s1s2s3;
      |          ^~~~~~
a.cc:6:13: error: 's1' was not declared in this scope; did you mean 'y1'?
    6 |   cout << ( s1 + s2 + s3 ) % 9 << endl;
      |             ^~
      |             y1
a.cc:6:18: error: 's2' was not declared in this scope
    6 |   cout << ( s1 + s2 + s3 ) % 9 << endl;
      |                  ^~
a.cc:6:23: error: 's3' was not declared in this scope
    6 |   cout << ( s1 + s2 + s3 ) % 9 << endl;
      |                       ^~
Language: C++

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

int main() {
  int s1 = 1;
  int s2 = 0;
  int s3 = 1; 
  cin >> a >> b;
  cout << ( s1 + s2 + s3 ) % 9 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'a' was not declared in this scope
    8 |   cin >> a >> b;
      |          ^
a.cc:8:15: error: 'b' was not declared in this scope
    8 |   cin >> a >> b;
      |               ^
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:7:10: error: 'abc' was not declared in this scope; did you mean 'abs'?
    7 |   cin >> abc;
      |          ^~~
      |          abs
Language: C++

#iclude <bits/stdc++.h>
using namespace std;
int main(){
  int s1,s2,s3;
  cin >> s1 >> s2 >> s3;
  cout << s1 + s2 + s3;
  return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #iclude; did you mean #include?
    1 | #iclude <bits/stdc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> s1 >> s2 >> s3;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #iclude <bits/stdc++.h>
a.cc:6:3: error: 'cout' was not declared in this scope
    6 |   cout << s1 + s2 + s3;
      |   ^~~~
a.cc:6:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#iclude <bits/stdc++.h>
using namespace std;
int main(){
  int s1,s2,s3;
  cin >> s1,s2,s3;
  cout << s1 + s2 + s3;
  return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #iclude; did you mean #include?
    1 | #iclude <bits/stdc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> s1,s2,s3;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #iclude <bits/stdc++.h>
a.cc:6:3: error: 'cout' was not declared in this scope
    6 |   cout << s1 + s2 + s3;
      |   ^~~~
a.cc:6:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

using namespace std;

int main(){
	int s;
	int count=0;
	int num;

	cin >> s;

	num = s;

	for(int i=0;i<3;i++){
		if(num%10==1){
			count++;
		}
		num = num/10;
	}

	cout << count << endl;s

}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:32: error: expected ';' before '}' token
   25 |         cout << count << endl;s
      |                                ^
      |                                ;
   26 | 
   27 | }
      | ~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: expected ';' before 'cout'
    9 |   x = a % 3
      |            ^
      |            ;
   10 | 
   11 |   cout << x << endl;
      |   ~~~~
Language: C++

#include <iostream>
using namespace std;

int main()
{
    string s;
    cin >> s;
    int counter = 0;
    for (int i = 0; i < s.size(); i++) {
        if s[i] == "1"
            counter++;
    }

    cout << counter;
}

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

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

int main() {
  string s;
  cin >> s;
  int s1 = stoi(s[0]), s2 = stoi(s[1]), s3 = stoi(s[2]);
  cout << s1 + s2 + s3 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
    7 |   int s1 = stoi(s[0]), s2 = stoi(s[1]), s3 = stoi(s[2]);
      |            ~~~~^~~~~~
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:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
a.cc:8:16: error: 's2' was not declared in this scope; did you mean 's1'?
    8 |   cout << s1 + s2 + s3 << endl;
      |                ^~
      |                s1
a.cc:8:21: error: 's3' was not declared in this scope; did you mean 's1'?
    8 |   cout << s1 + s2 + s3 << endl;
      |                     ^~
      |                     s1
Language: C

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

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

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

int main() {
 string s;
 int sum = 0;

 if(s[1] == '1'){
     sum++;
 }
 if(s[2] == '1'){
     sum++;
 }
 if(s[3] == '1'){
     sum++
 }

 cout << sum << endl;
}

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:2: error: expected '}' at end of input
   14 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | 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;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int)'
   10 |   if(s(0) =='1') ++counter;
      |      ~^~~
a.cc:11:7: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int)'
   11 |   if(s(1) =='1') ++counter;
      |      ~^~~
a.cc:12:7: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int)'
   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(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:7: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int)'
   10 |   if(s(0) =='1') count++;
      |      ~^~~
a.cc:11:7: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int)'
   11 |   if(s(1) =='1') count++;
      |      ~^~~
a.cc:12:7: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int)'
   12 |   if(s(2) =='1') count++;
      |      ~^~~
Language: C++

#include<iostream> 
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:9:7: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int)'
    9 |   if(s(0) =='1') count++;
      |      ~^~~
a.cc:10:7: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int)'
   10 |   if(s(1) =='1') count++;
      |      ~^~~
a.cc:11:7: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int)'
   11 |   if(s(2) =='1') count++;
      |      ~^~~
Language: C++

#include<iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> vec(3);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> vec(3);
      |          ^~~
a.cc:8:34: error: 'vec' was not declared in this scope
    8 |   for (int i=0; i<3; i++) cin >> vec.at(i);
      |                                  ^~~
a.cc:10:7: error: redeclaration of 'int s'
   10 |   int s=0;
      |       ^
a.cc:5:7: note: 'int s' previously declared here
    5 |   int s;
      |       ^
a.cc:11:7: error: 'vec' was not declared in this scope
   11 |   if (vec.at(i) == 1) {
      |       ^~~
a.cc:11:14: error: 'i' was not declared in this scope
   11 |   if (vec.at(i) == 1) {
      |              ^