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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'map' was not declared in this scope
    8 |         if (map[0] == 1) {
      |             ^~~
a.cc:2:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    1 | #include<iostream>
  +++ |+#include <map>
    2 | #include<string>
a.cc:11:13: error: 'map' was not declared in this scope
   11 |         if (map[1] == 1) {
      |             ^~~
a.cc:11:13: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
a.cc:14:13: error: 'map' was not declared in this scope
   14 |         if (map[2] == 1) {
      |             ^~~
a.cc:14:13: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'map' was not declared in this scope
    8 |         if (map[0] == 1) {
      |             ^~~
a.cc:2:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    1 | #include<iostream>
  +++ |+#include <map>
    2 | #include<string>
a.cc:11:13: error: 'map' was not declared in this scope
   11 |         if (map[1] == 1) {
      |             ^~~
a.cc:11:13: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
a.cc:14:13: error: 'map' was not declared in this scope
   14 |         if (map[2] == 1) {
      |             ^~~
a.cc:14:13: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main() {
  int A,B,C;
  
  
  cin >> A >> B >> C;
  
  D = A+B+C;
  
  cout << D << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'D' was not declared in this scope
   10 |   D = A+B+C;
      |   ^
Language: C++

//平方数判定
#include <iostream>
#include <string>

using namespace std;

int main(void){
  string s1,s2,s3;
  int count = 0;
  cin >> s1>>s2>>s3;
  //cout << s1<<s2<<s3;
  if(stio(s1) == 1)count++;
  if(stio(s2) == 1)count++;
  if(stio(s3) == 1)count++;
  cout <<count;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:6: error: 'stio' was not declared in this scope
   12 |   if(stio(s1) == 1)count++;
      |      ^~~~
a.cc:13:6: error: 'stio' was not declared in this scope
   13 |   if(stio(s2) == 1)count++;
      |      ^~~~
a.cc:14:6: error: 'stio' was not declared in this scope
   14 |   if(stio(s3) == 1)count++;
      |      ^~~~
Language: C++

#include <iostream>

int
main()
{
  int s;
  cin >> s;
  int n = 0;
  switch(s) {
    case 0:
      n = 0;
      break;
    case 1:
      n = 1;
      break;
    case 10:
      n = 1;
      break;
    case 11:
      n = 2;
      break;
    case 100:
      n = 1;
      break;
    case 101:
      n = 2;
      break;
    case 110:
      n = 2;
      break;
    case 111:
      n = 3;
      break;
    default:
      break;
  }
  cout << n << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> s;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:37:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   37 |   cout << n << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:37:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   37 |   cout << n << endl;
      |                ^~~~
      |                std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, i, cnt=0;
  bool f = true;
  cin >> N;
  int A[200];
  for(i = 0;i < N; i++){
  	cin >> A[i];
  }
  
  while(f == true)
    for( i=0; i<N; i++){
      if(A[i] % 2 == 1){
        f = false;
        break;
      }
    }
  	if(f == true){
      for( i=0; i<N; i++){
        A[i] /= 2;
      }
      cnt++;
    }
  }
  cout << cnt << endl;

  return 0;
}


Compiler output:
a.cc:27:3: error: 'cout' does not name a type
   27 |   cout << cnt << endl;
      |   ^~~~
a.cc:29:3: error: expected unqualified-id before 'return'
   29 |   return 0;
      |   ^~~~~~
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

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

  return 0;
}

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

#include <iostream>
using namespace std;

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


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

#include <iostream>
#include <string>

using namespace std;

int ans;
string s;

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

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

"/mnt/c/Users/keita/OneDrive - Tokyo University of Agriculture and Technology/Cplusplus/cmake-build-debug/Cplusplus"
101
101
1

Process finished with exit code 0


Compiler output:
a.cc:1:1: error: expected unqualified-id before string constant
    1 | "/mnt/c/Users/keita/OneDrive - Tokyo University of Agriculture and Technology/Cplusplus/cmake-build-debug/Cplusplus"
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

class Main {
    public static void main(String[] args) throws java.Exception {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        final long count = Arrays.stream(br.readLine().split("")).filter(i -> i.equals("1")).count();
        System.out.println(count);

    }
}

Compiler output:
Main.java:6: error: cannot find symbol
    public static void main(String[] args) throws java.Exception {
                                                      ^
  symbol:   class Exception
  location: package java
1 error
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'a' was not declared in this scope
   12 |         a++;
      |         ^
a.cc:15:9: error: 'a' was not declared in this scope
   15 |         a++;
      |         ^
a.cc:18:9: error: 'a' was not declared in this scope
   18 |         a++;
      |         ^
Language: C++

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

int main()
{
    int ans=0;
    string s;
    cin >>s;

    if(ans[0]=='1'){
        a++;
    }
    if(ans[1]=='1'){
        a++;
    }
    if(ans[2]=='1'){
        a++;

    cout<<a<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: invalid types 'int[int]' for array subscript
   11 |     if(ans[0]=='1'){
      |           ^
a.cc:12:9: error: 'a' was not declared in this scope
   12 |         a++;
      |         ^
a.cc:14:11: error: invalid types 'int[int]' for array subscript
   14 |     if(ans[1]=='1'){
      |           ^
a.cc:15:9: error: 'a' was not declared in this scope
   15 |         a++;
      |         ^
a.cc:17:11: error: invalid types 'int[int]' for array subscript
   17 |     if(ans[2]=='1'){
      |           ^
a.cc:18:9: error: 'a' was not declared in this scope
   18 |         a++;
      |         ^
Language: C++

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

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

Compiler output:
a.cc:14:16: warning: multi-character character constant [-Wmultichar]
   14 |         cout <<'ans'<<endl;
      |                ^~~~~
a.cc: In function 'int main()':
a.cc:10:25: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   10 |         if(ans[0]==1)ans++;
      |                      ~~~^~
a.cc:11:25: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   11 |         if(ans[1]==1)ans++;
      |                      ~~~^~
a.cc:12:25: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   12 |         if(ans[2]==1)ans++;
      |                      ~~~^~
Language: C++

using namespace std;

int main(void)
{
    long long int a=0,b,c,d,i,j,k,n;
    string s;
    char C[5];

    cin >> s;
    for(i=0;i<3;i++){
        if(s.at(i)=='1') a++;
    }
    cout << a;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'string' was not declared in this scope
    6 |     string s;
      |     ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:9:5: error: 'cin' was not declared in this scope
    9 |     cin >> s;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:9:12: error: 's' was not declared in this scope
    9 |     cin >> s;
      |            ^
a.cc:13:5: error: 'cout' was not declared in this scope
   13 |     cout << a;
      |     ^~~~
a.cc:13:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: no match for call to '(std::vector<int>) (int&)'
    8 |     cin >> s(i);
      |            ~^~~
a.cc:9:9: error: no match for call to '(std::vector<int>) (int&)'
    9 |     if(s(i)==1){
      |        ~^~~
Language: C++

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

int main(){
  vecotr<int> s(3);
  int x=0;
  for(int i=0; i < 3; i++){
    cin >> s(i);
    if(s(i)==1){
      x++;
    }
  }
  cout << x << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'vecotr' was not declared in this scope
    5 |   vecotr<int> s(3);
      |   ^~~~~~
a.cc:5:10: error: expected primary-expression before 'int'
    5 |   vecotr<int> s(3);
      |          ^~~
a.cc:8:12: error: 's' was not declared in this scope
    8 |     cin >> s(i);
      |            ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         if (str.at(i) == "1") {
      |             ~~~~~~~~~~^~~~~~
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;
count << counter << endl;
}

Compiler output:
a.cc:7:1: error: 'cin' does not name a type
    7 | cin >> s;
      | ^~~
a.cc:9:1: error: expected unqualified-id before 'if'
    9 | if (s[0] =='1' ) ++counter;
      | ^~
a.cc:10:1: error: expected unqualified-id before 'if'
   10 | if (s[1] =='1' ) ++counter;
      | ^~
a.cc:11:1: error: expected unqualified-id before 'if'
   11 | if (s[2] =='1' ) ++counter;
      | ^~
a.cc:12:1: error: 'count' does not name a type
   12 | count << counter << endl;
      | ^~~~~
a.cc:13:1: error: expected declaration before '}' token
   13 | }
      | ^
Language: C++

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

int main() {
  int s;
  cin >> s;
  int a, b, c;
  a = s * 0.01
  b = (s - a*100)* 0.1
  c = (s - a*100 - b*10)
  cout <<  a + b + c << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: expected ';' before 'b'
    8 |   a = s * 0.01
      |               ^
      |               ;
    9 |   b = (s - a*100)* 0.1
      |   ~
Language: C++

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

int main() {
  int s1, s2, s3;
  int a = s1s2s3;
  cin >> a;
  cout << s1 + s2 + s3 << endl;
}


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

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

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


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: 's1' was not declared in this scope; did you mean 'y1'?
    6 |   cin >> s1 >> s2 >> s3;
      |          ^~
      |          y1
a.cc:6:16: error: 's2' was not declared in this scope
    6 |   cin >> s1 >> s2 >> s3;
      |                ^~
a.cc:6:22: error: 's3' was not declared in this scope
    6 |   cin >> s1 >> s2 >> s3;
      |                      ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int s;
  cin >> s;
  int temp;
  int count = 0;
  for(i=100; i>1; i/10){
  	temp = s / i;
    if(temp == 1){
      count++;
      s = s - i;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'i' was not declared in this scope
    9 |   for(i=100; i>1; i/10){
      |       ^
Language: C++

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

int main(){
  int s;
  cin >> s;
  int count;
  for(i=100; i>1; i/10){
    int temp  = s / i;
    if(temp == 1){
      count++;
      s = s - i;
    }
  }
  cout << count << 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 >> s;
      |   ^~~
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i=100; i>1; i/10){
      |       ^
a.cc:15:3: error: 'cout' was not declared in this scope; did you mean 'count'?
   15 |   cout << count << endl;
      |   ^~~~
      |   count
a.cc:15:20: error: 'endl' was not declared in this scope
   15 |   cout << count << endl;
      |                    ^~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: expected ';' before '==' token
    8 |   for(int i == 0; i < size; i++){
      |            ^~~
      |            ;
a.cc:8:13: error: expected primary-expression before '==' token
    8 |   for(int i == 0; i < size; i++){
      |             ^~
a.cc:8:27: error: expected ')' before ';' token
    8 |   for(int i == 0; i < size; i++){
      |      ~                    ^
      |                           )
a.cc:8:29: error: 'i' was not declared in this scope
    8 |   for(int i == 0; i < size; i++){
      |                             ^
Language: Java

import java.util.*;
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner();
    int s1 = sc.nextInt();
    int s2 = sc.nextInt();
    int s3 = sc.nextInt();
    switch(s1 + s2 + s3){
      case 0:
        System.out.println(0);
        break;
      case 1:
        System.out.println(1);
        break;
      case 2:
        System.out.println(2);
        break;
      case 3:
        System.out.println(3);
        break;
    }
  }
}

Compiler output:
Main.java:4: error: no suitable constructor found for Scanner(no arguments)
    Scanner sc = new Scanner();
                 ^
    constructor Scanner.Scanner(Readable,Pattern) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Readable) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,CharsetDecoder) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,Charset) is not applicable
      (actual and formal argument lists differ in length)
1 error
Language: Java

import java.util.*;
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner;
    int s1 = sc.nextint();
    int s2 = sc.nextInt();
    int s3 = sc.nextInt();
    switch(s1 + s2 + s3){
      case 0:
        System.out.println(0);
        break;
      case 1:
        System.out.println(1);
        break;
      case 2:
        System.out.println(2);
        break;
      case 3:
        System.out.println(3);
        break;
    }
  }
}

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

import java.util.*;
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner();
    int s1 = sc.nextint();
    int s2 = sc.nextInt();
    int s3 = sc.nextInt();
    switch(s1 + s2 + s3){
      case 0:
        System.out.println(0);
        break;
      case 1:
        System.out.println(1);
        break;
      case 2:
        System.out.println(2);
        break;
      case 3:
        System.out.println(3);
        break;
    }
  }
}

Compiler output:
Main.java:4: error: no suitable constructor found for Scanner(no arguments)
    Scanner sc = new Scanner();
                 ^
    constructor Scanner.Scanner(Readable,Pattern) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Readable) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,CharsetDecoder) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,Charset) is not applicable
      (actual and formal argument lists differ in length)
Main.java:5: error: cannot find symbol
    int s1 = sc.nextint();
               ^
  symbol:   method nextint()
  location: variable sc of type Scanner
2 errors
Language: Java

import java.util.*;

class Main {

    public static void main(String[], args) {

        int one,two,three;
        Scanner sacnner = new Scanner();

        one = scanner.nextInt();
        tow = scanner.nextInt();
        three = scanner.nextInt();

        if (one != 0 || tow != 0 || three != 0) {
            SYstem.out.println((one + tow + three));
        } else {
            System.out.println("0");
        }




    }

}


Compiler output:
Main.java:5: error: <identifier> expected
    public static void main(String[], args) {
                                    ^
Main.java:5: error: <identifier> expected
    public static void main(String[], args) {
                                          ^
2 errors
Language: C++

package main

import (
	"fmt"
)

func main() {
	var (
		a     string
		count = 0
	)
	fmt.Scan(&a)
	for i := 0; i < len(a); i++ {
		if a[i] == '1' {
			count++
		}
	}
	fmt.Println(count)
}


Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
Language: C++

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

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

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

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

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  cout << N / 100 + (M % 100) / 10 + N % 10 << enldl;
}

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  cout << N / 100 + (M % 100) / 10 + N % 10 >> enldl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:22: error: 'M' was not declared in this scope
    7 |   cout << N / 100 + (M % 100) / 10 + N % 10 >> enldl;
      |                      ^
a.cc:7:48: error: 'enldl' was not declared in this scope
    7 |   cout << N / 100 + (M % 100) / 10 + N % 10 >> enldl;
      |                                                ^~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: expected unqualified-id before '[' token
    9 |   if(string[0] == "1") ++counter
      |            ^
a.cc:9:33: error: expected ';' before 'if'
    9 |   if(string[0] == "1") ++counter
      |                                 ^
      |                                 ;
   10 |   if(string[1] == "1") ++counter
      |   ~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'a' was not declared in this scope
    8 |   x = a + b + c ;
      |       ^
a.cc:8:11: error: 'b' was not declared in this scope
    8 |   x = a + b + c ;
      |           ^
a.cc:8:15: error: 'c' was not declared in this scope
    8 |   x = a + b + c ;
      |               ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: expected primary-expression before '>' token
    6 |   cin >> a > >b >> c ;
      |              ^
Language: C++

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


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

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

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

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

int main() {
  unsighed int a, b, c;
  while(a<2 && b<2 && c<2){
	cin >> a >> b >> c;
  }
  cout << a * b * c << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'unsighed' was not declared in this scope; did you mean 'unsigned'?
    5 |   unsighed int a, b, c;
      |   ^~~~~~~~
      |   unsigned
a.cc:6:9: error: 'a' was not declared in this scope
    6 |   while(a<2 && b<2 && c<2){
      |         ^
a.cc:6:16: error: 'b' was not declared in this scope
    6 |   while(a<2 && b<2 && c<2){
      |                ^
a.cc:6:23: error: 'c' was not declared in this scope
    6 |   while(a<2 && b<2 && c<2){
      |                       ^
a.cc:9:11: error: 'a' was not declared in this scope
    9 |   cout << a * b * c << endl;
      |           ^
a.cc:9:15: error: 'b' was not declared in this scope
    9 |   cout << a * b * c << endl;
      |               ^
a.cc:9:19: error: 'c' was not declared in this scope
    9 |   cout << a * b * c << endl;
      |                   ^
Language: C++

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: expected primary-expression before ';' token
    6 |   cin >> ;
      |          ^
a.cc:11:14: error: expected ';' before 'cout'
   11 |   s3 = a % 10
      |              ^
      |              ;
   12 | 
   13 |  cout << s1+s2+s3 << endl ;
      |  ~~~~
Language: C++

#include <iostream>

using namespace std;

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

int cnt,sum=0;
for(cnt=0;cnt<sizeof(s-1)/sizeof(s[0]);cnt++)
{
if(s[cnt]) sum++;
}
cout<<sum<<endl;
return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: no match for 'operator-' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
   11 | for(cnt=0;cnt<sizeof(s-1)/sizeof(s[0]);cnt++)
      |                      ~^~
      |                      | |
      |                      | int
      |                      std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/string:48,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  618 |     operator-(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note:   template argument deduction/substitution failed:
a.cc:11:24: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
   11 | for(cnt=0;cnt<sizeof(s-1)/sizeof(s[0]);cnt++)
      |                        ^
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1790 |     operator-(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note:   template argument deduction/substitution failed:
a.cc:11:24: note:   'std::string' {aka 'std::__cxx11::basic_string<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
   11 | for(cnt=0;cnt<sizeof(s-1)/sizeof(s[0]);cnt++)
      |                        ^
Language: Java

import java.util.*;
 
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.text();
    s = s.replace("o","");
    System.out.println(s.length());
  }
}

Compiler output:
Main.java:6: error: cannot find symbol
    String s = sc.text();
                 ^
  symbol:   method text()
  location: variable sc of type Scanner
1 error
Language: Java

import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.text();
    s = replace("o","");
    System.out.println(s.length());
  }
}

Compiler output:
Main.java:6: error: cannot find symbol
    String s = sc.text();
                 ^
  symbol:   method text()
  location: variable sc of type Scanner
Main.java:7: error: cannot find symbol
    s = replace("o","");
        ^
  symbol:   method replace(String,String)
  location: class Main
2 errors
Language: C++

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

Compiler output:
a.cc:1:10: error: #include expects "FILENAME" or <FILENAME>
    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: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:7:3: error: 'cout' was not declared in this scope
    7 |   cout << a/100 + a/10 - a/100*10 + a - a/100*100 -(a/10*10- a/100*100);
      |   ^~~~
a.cc:7:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: Java

import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
      
        System.out.println(s);
        int x = 0;

        for(int i = 0; i < 3; i++){
            if(s.charAt(i) == '1') x++;
        }

        System.out.println(x);

        sc.close();
    }
}

Compiler output:
Main.java:7: error: cannot find symbol
        System.out.println(s);
                           ^
  symbol:   variable s
  location: class Main
Main.java:11: error: cannot find symbol
            if(s.charAt(i) == '1') x++;
               ^
  symbol:   variable s
  location: class Main
2 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a;
  cin >> a;
  int first;
  first = a/100;
  int second;
  second = a/2;
  second = second/5;
  second = second%10;
  
  int halfthird;
  halfthird = a/2
  double HALFTHIRD;
  HALFTHIRD = a;
  HALFTHIRD = HALFTHIRD/2;
  double different;
  different = (HALFTHIRD - halfthird)*2;
  int third;
  third = different;
  
  int answer;
  answer = first + second + third;  
  cout << answer << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: expected ';' before 'double'
   15 |   halfthird = a/2
      |                  ^
      |                  ;
   16 |   double HALFTHIRD;
      |   ~~~~~~          
a.cc:17:3: error: 'HALFTHIRD' was not declared in this scope
   17 |   HALFTHIRD = a;
      |   ^~~~~~~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

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


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

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

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

  if (s1s2s3 = 000 {
    cout << 0 << endl;
  }
  if (s1s2s3 = 001 {
    cout << 1 << endl;
  }
    if (s1s2s3 = 010 {
    cout << 1 << endl;
  }
    if (s1s2s3 = 011 {
    cout << 2 << endl;
  }
        if (s1s2s3 = 100 {
    cout << 1 << endl;
  }
           if (s1s2s3 = 101 {
    cout << 2 << endl;
  } 
               if (s1s2s3 = 110 {
    cout << 2 << endl;
  }
                  if (s1s2s3 = 111 {
    cout << 3 << endl;
  } 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: expected ')' before '{' token
    8 |   if (s1s2s3 = 000 {
      |      ~            ^~
      |                   )
a.cc:32:1: error: expected primary-expression before '}' token
   32 | }
      | ^
Language: C++

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

int main() {
  int a, b, c, d, e, f, aya;
  cin >> a;
  b = a % 1;
  aya = b;
  a = a - b;
  c = a % 10;
  aya = aya + c;
  a = a - c;
  d = d % 100;
  aya = aya + d
  cout << aya << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: expected ';' before 'cout'
   14 |   aya = aya + d
      |                ^
      |                ;
   15 |   cout << aya << endl;
      |   ~~~~
Language: C++

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

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

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

#include <iostream>
#include <string>
#include <cstdlib>
 
using namespace std;
 
int main(){
	string str;
	cin >> str;
	int cnt = 0;
  for(int i = 0; i < 3; ++i){
    if(atoi(str[i]) == 1)++cnt;
  }
	cout << cnt << endl;
	return 0;
}

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

#include <iostream>
#include <string>
 
using namespace std;
 
int main(){
	string str;
	cin >> str;
	int cnt = 0;
  for(int i = 0; i < 3; ++i){
    if(stoi(str[i]) == 1)++cnt;
  }
	cout << cnt << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   11 |     if(stoi(str[i]) == 1)++cnt;
      |        ~~~~^~~~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/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)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
	string str;
	cin >> str;
	int cnt = 0;
  for(int i = 0; i < 3; ++i){
    stoi(str[i] == 1)++cnt;
  }
	cout << cnt << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: no matching function for call to 'stoi(bool)'
   11 |     stoi(str[i] == 1)++cnt;
      |     ~~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/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 'bool' 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 'bool' to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: expected ',' or ';' before 'string'
    5 |   string S1;
      |   ^~~~~~
a.cc:6:10: error: 'S1' was not declared in this scope; did you mean 'y1'?
    6 |   cin >> S1;
      |          ^~
      |          y1
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: expected ',' or ';' before 'string'
    5 |   string S1;
      |   ^~~~~~
a.cc:6:10: error: 'S1' was not declared in this scope; did you mean 'y1'?
    6 |   cin >> S1;
      |          ^~
      |          y1
a.cc:8:6: error: 'S2' was not declared in this scope
    8 |   if(S2[1]== 1 ) ans++;
      |      ^~
a.cc:9:6: error: 'S3' was not declared in this scope
    9 |   if(S3[2]== 1 ) ans++;
      |      ^~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: invalid types 'int[int]' for array subscript
    6 |   cout << S1[0] + S1[1] + S1[2] << endl;
      |             ^
a.cc:6:21: error: invalid types 'int[int]' for array subscript
    6 |   cout << S1[0] + S1[1] + S1[2] << endl;
      |                     ^
a.cc:6:29: error: invalid types 'int[int]' for array subscript
    6 |   cout << S1[0] + S1[1] + S1[2] << endl;
      |                             ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
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() {
  int a,b,c;
  cin >> a >> b;
  cotu << a+b+c << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'cotu' was not declared in this scope
    7 |   cotu << a+b+c << endl;
      |   ^~~~
Language: C++

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


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

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

Compiler output:
a.cc:1:21: warning: extra tokens at end of #include directive
    1 | #include <iostream> #include <string> using namespace std; int ans; string s; int main(){ cin >> s; if(s[0]=='1') ans++; if(s[1]=='1') ans++; if(s[2]=='1') ans++; cout << ans << endl; }
      |                     ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
using namespace std;
 
int main(){
  string s;
  cin >> s;
  cout << accumulate(s.begin(), s.end(), '0') - 3* '0' << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: 'accumulate' was not declared in this scope
    7 |   cout << accumulate(s.begin(), s.end(), '0') - 3* '0' << endl;
      |           ^~~~~~~~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
  string s;
  cin >> s;
  cout << accumulate(s.begin(), s.end(), 0) - 3* '0' << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: 'accumulate' was not declared in this scope
    7 |   cout << accumulate(s.begin(), s.end(), 0) - 3* '0' << endl;
      |           ^~~~~~~~~~
Language: C++

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

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



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