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

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

Compiler output:
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include
      |         ^
a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   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 | #include
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   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 | #include
a.cc:5:10: error: 's' was not declared in this scope
    5 |   cin >> s;
      |          ^
a.cc:12:3: error: 'cout' was not declared in this scope
   12 |   cout << count << endl;
      |   ^~~~
a.cc:12:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:20: error: 'endl' was not declared in this scope
   12 |   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
Language: C++

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

Compiler output:
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include
      |         ^
a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   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 | #include
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   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 | #include
a.cc:5:10: error: 's' was not declared in this scope
    5 |   cin >> s;
      |          ^
a.cc:10:3: error: 'cout' was not declared in this scope
   10 |   cout << count << endl;
      |   ^~~~
a.cc:10:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:20: error: 'endl' was not declared in this scope
   10 |   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
Language: C++

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

Compiler output:
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include
      |         ^
a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   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 | #include
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   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 | #include
a.cc:5:10: error: 's' was not declared in this scope
    5 |   cin >> s;
      |          ^
a.cc:10:3: error: 'cout' was not declared in this scope
   10 |   cout << count << endl;
      |   ^~~~
a.cc:10:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:20: error: 'endl' was not declared in this scope
   10 |   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
Language: C++

#include
using namespace std;
int main(){
  string s;
  cin << s;
  int count = 0;
  if(s.at(0) == '1'){ count++}
  if(s.at(1) == '1'){count++}
  if(s.at(2) == '1'){count++}
  cout << count << endl;
}

Compiler output:
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include
      |         ^
a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   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 | #include
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   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 | #include
a.cc:5:10: error: 's' was not declared in this scope
    5 |   cin << s;
      |          ^
a.cc:7:30: error: expected ';' before '}' token
    7 |   if(s.at(0) == '1'){ count++}
      |                              ^
      |                              ;
a.cc:8:29: error: expected ';' before '}' token
    8 |   if(s.at(1) == '1'){count++}
      |                             ^
      |                             ;
a.cc:9:29: error: expected ';' before '}' token
    9 |   if(s.at(2) == '1'){count++}
      |                             ^
      |                             ;
a.cc:10:3: error: 'cout' was not declared in this scope
   10 |   cout << count << endl;
      |   ^~~~
a.cc:10:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:20: error: 'endl' was not declared in this scope
   10 |   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
Language: C++

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

Compiler output:
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include
      |         ^
a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   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 | #include
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   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 | #include
a.cc:5:10: error: 's' was not declared in this scope
    5 |   cin >> s;
      |          ^
a.cc:10:3: error: 'cout' was not declared in this scope
   10 |   cout << count << endl;
      |   ^~~~
a.cc:10:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:20: error: 'endl' was not declared in this scope
   10 |   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
Language: C++

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

Compiler output:
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include
      |         ^
a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   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 | #include
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   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 | #include
a.cc:5:10: error: 's' was not declared in this scope
    5 |   cin >> s;
      |          ^
a.cc:7:30: error: expected ';' before '}' token
    7 |   if(s.at(0) == '1'){ count++}
      |                              ^
      |                              ;
a.cc:8:29: error: expected ';' before '}' token
    8 |   if(s.at(1) == '1'){count++}
      |                             ^
      |                             ;
a.cc:9:29: error: expected ';' before '}' token
    9 |   if(s.at(2) == '1'){count++}
      |                             ^
      |                             ;
a.cc:10:3: error: 'cout' was not declared in this scope
   10 |   cout << count << endl;
      |   ^~~~
a.cc:10:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:20: error: 'endl' was not declared in this scope
   10 |   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
Language: C++

#include
using namespace std;
int main(){
  string s;
  cin << s;
  int count;
  if(s.at(0) == '1'){ count++}
  if(s.at(1) == '1'){count++}
  if(s.at(2) == '1'){count++}
  cout << count << endl;
}

Compiler output:
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include
      |         ^
a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   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 | #include
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   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 | #include
a.cc:5:10: error: 's' was not declared in this scope
    5 |   cin << s;
      |          ^
a.cc:7:30: error: expected ';' before '}' token
    7 |   if(s.at(0) == '1'){ count++}
      |                              ^
      |                              ;
a.cc:8:29: error: expected ';' before '}' token
    8 |   if(s.at(1) == '1'){count++}
      |                             ^
      |                             ;
a.cc:9:29: error: expected ';' before '}' token
    9 |   if(s.at(2) == '1'){count++}
      |                             ^
      |                             ;
a.cc:10:3: error: 'cout' was not declared in this scope
   10 |   cout << count << endl;
      |   ^~~~
a.cc:10:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:20: error: 'endl' was not declared in this scope
   10 |   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
Language: C

#include<stdio.h>

int main(void){
  char str[4];
  int i,count;
  scanf("%s",s);
   for(i=0;str[i]!='\0';i++){
     if(str[i]='1'){
       count++;
     }
   }
  prntf("%d",count);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:14: error: 's' undeclared (first use in this function)
    6 |   scanf("%s",s);
      |              ^
main.c:6:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:3: error: implicit declaration of function 'prntf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   12 |   prntf("%d",count);
      |   ^~~~~
      |   printf
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
          Scanner sc = new Scanner(System.in);
          int num = sc.nextInt();
          int count;
          int[] number = num.split[0-2];
          for(int i = 0; i < 3; i++){
            if(num[i] == 1){
              count++;
            }
          }
          System.out.println(count);
        }
    }


Compiler output:
Main.java:8: error: int cannot be dereferenced
          int[] number = num.split[0-2];
                            ^
Main.java:10: error: array required, but int found
            if(num[i] == 1){
                  ^
2 errors
Language: C++

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:27: error: request for member 'size' in 's', which is of non-class type 'int'
    8 |     for (int i = 0; i < s.size(); ++i) {
      |                           ^~~~
a.cc:9:14: error: invalid types 'int[int]' for array subscript
    9 |         if (s[i] == '1') ans++;
      |              ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:27: error: request for member 'size' in 's', which is of non-class type 'int'
    8 |     for (int i = 0; i < s.size(); ++i) {
      |                           ^~~~
a.cc:9:14: error: invalid types 'int[int]' for array subscript
    9 |         if (s[i] == '1') ans++;
      |              ^
a.cc:11:23: error: expected '}' at end of input
   11 |   cout << ans << endl;
      |                       ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:7: error: expected unqualified-id before '>>' token
    5 |   int >> s1,s2,s3 ;
      |       ^~
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 a,b,c;
  cin >> a >> b >> c;
  cout << a+b+c << endl
}

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

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

int main(){
  	char c[3];
  	cin >> c;
  	cout << atoi(c[0]) + atoi(c[1]) + atoi(c[2]);
	return 0;
}

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


using namespace std;


int main()
{
	int	a[200],n;

	cin >>n;

	for(int i=0;i<n;i++)
	{
		cin >> a[i];
	}

	int c=0;
	while(1)
	{
		for(int i=0;i<n;i++)
		{
			if(a[i]%2==1)
			{
				cout << c;
				return 0;
			}
			a[i]=a[i]/2;
		}
		c++;
	}
	cout << c;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope
    9 |         cin >>n;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | 
a.cc:23:33: error: 'cout' was not declared in this scope
   23 |                                 cout << c;
      |                                 ^~~~
a.cc:23:33: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:30:9: error: 'cout' was not declared in this scope
   30 |         cout << c;
      |         ^~~~
a.cc:30:9: 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 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:9:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |   if (s[0]=="1")  ans++;
a.cc:10:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |   if (s[1]=="1")  ans++;
a.cc:11:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |   if (s[2]=="1")  ans++;
Language: C++

#include <bits/stdc++.h>
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:9:14: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
    9 |   if (s[0] = "1")  ans++;
      |              ^~~
      |              |
      |              const char*
a.cc:10:14: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   10 |   if (s[1] = "1")  ans++;
      |              ^~~
      |              |
      |              const char*
a.cc:11:14: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   11 |   if (s[2] = "1")  ans++;
      |              ^~~
      |              |
      |              const char*
Language: C++

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

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



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

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

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



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

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: 'a' was not declared in this scope
    6 |    cin >> a ;
      |           ^
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    char[] s = new char[10];
    s = sc.next();
    int sum = 0;
    for(int i = 0; i < 3;++i){
      if(s[i] == '1' )
        ++sum;
    }
    System.out.println(sum);
  }
  
}

Compiler output:
Main.java:6: error: incompatible types: String cannot be converted to char[]
    s = sc.next();
               ^
1 error
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String ss = "1";
    int sum = 0;
    for(int i = 0; i < s.length();++i){
      if(ss.equals(s[i]))
        ++sum;
    }
    System.out.println(sum);
  }
  
}

Compiler output:
Main.java:9: error: array required, but String found
      if(ss.equals(s[i]))
                    ^
1 error
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String ss = "1";
    int sum = 0;
    for(int i = 0; i < s.length();++i){
      if(s[i] == ss )
        ++sum;
    }
    System.out.println(sum);
  }
  
}

Compiler output:
Main.java:9: error: array required, but String found
      if(s[i] == ss )
          ^
1 error
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    int sum = 0;
    for(int i = 0; i < s.length();++i){
      if(s[i] == '1' )
        ++sum;
    }
    System.out.println(sum);
  }
  
}

Compiler output:
Main.java:8: error: array required, but String found
      if(s[i] == '1' )
          ^
1 error
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    7 |   for(int i = 0;i < s.length;++i){
      |                     ~~^~~~~~
      |                             ()
Language: C++

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

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


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

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

int main() {
  int Z;
  for(i=0;i<3;i++){
    char a;
    cin>>a;
    if(a=='1'){
      Z++;
    }
  }
  cout<<Z<<endl;
}


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

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

int main(){
  int s=0;
  cin >> s;
  int b[3];
  for(int i = 0; i < 3; i++){
    b[i] = s / pow(10, i);
    cout << b[i] << flash;
  }
  cout << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: 'flash' was not declared in this scope; did you mean 'fflush'?
   11 |     cout << b[i] << flash;
      |                     ^~~~~
      |                     fflush
Language: C++

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

int main(){
  int s=0;
  cin >> s;
  int b[3];
  for(int i = 0; i < 3; i++){
    b[i] = s / (pow(10, i);
    cout << b[i] << flash;
  }
  cout << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:27: error: expected ')' before ';' token
   10 |     b[i] = s / (pow(10, i);
      |                ~          ^
      |                           )
a.cc:11:21: error: 'flash' was not declared in this scope; did you mean 'fflush'?
   11 |     cout << b[i] << flash;
      |                     ^~~~~
      |                     fflush
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:15: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
    8 |     if(s[0] = "1"){count++;}
      |               ^~~
      |               |
      |               const char*
a.cc:9:15: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
    9 |     if(s[1] = "1"){count++;}
      |               ^~~
      |               |
      |               const char*
a.cc:10:15: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   10 |     if(s[2] = "1"){count++;}
      |               ^~~
      |               |
      |               const char*
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:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |     if(s[0] == "1"){count++;}
a.cc:9:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     if(s[1] == "1"){count++;}
a.cc:10:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if(s[2] == "1"){count++;}
Language: C++

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:2:5: error: 'string' was not declared in this scope
    2 |     string s;
      |     ^~~~~~
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> s;
      |     ^~~
a.cc:3:12: error: 's' was not declared in this scope
    3 |     cin >> s;
      |            ^
a.cc:9:5: error: 'cout' was not declared in this scope; did you mean 'count'?
    9 |     cout >> count >> endl;
      |     ^~~~
      |     count
a.cc:9:22: error: 'endl' was not declared in this scope
    9 |     cout >> count >> endl;
      |                      ^~~~
Language: C++

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

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

  cout << a <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

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

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

  cout << a <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |     if(s[0]=='1') ans++;
      |                   ^~~
      |                   abs
a.cc:9:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |     if(s[1]=='1') ans++;
      |                   ^~~
      |                   abs
a.cc:10:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |     if(s[2]=='1') ans++;
      |                   ^~~
      |                   abs
a.cc:11:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

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

int main() {
  int a;
  cin a;
  int b=a%100;
  int x=(a-b)/100;
  int z=b%10:
  int y=(b-z)10;
  cout << x+y+z << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'a'
    6 |   cin a;
      |      ^~
      |      ;
a.cc:9:13: error: expected ',' or ';' before ':' token
    9 |   int z=b%10:
      |             ^
a.cc:11:13: error: 'y' was not declared in this scope
   11 |   cout << x+y+z << endl;
      |             ^
Language: C++

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

int main() {
  int a;
  cin a;
  int b=a%100;
  int x=(a-b)/100;
  int z=b%10:
  int y=(b-z)10
  cout << x+y+z << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'a'
    6 |   cin a;
      |      ^~
      |      ;
a.cc:9:13: error: expected ',' or ';' before ':' token
    9 |   int z=b%10:
      |             ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: 'i' was not declared in this scope
   10 |   if(s[i] == 0) {
      |        ^
Language: C

#include <stdio.h>
#include <string.h>
 
int main(void){
  char a[3];
  int b = 0
  int i = 0;
  scanf("%c",a);
  for(i = 0;i<3;i++){
   if(a[i] == 1){
     b++;
   }
  }
  printf("%d",b);
  
  return 0; 
}

Compiler output:
main.c: In function 'main':
main.c:7:3: error: expected ',' or ';' before 'int'
    7 |   int i = 0;
      |   ^~~
main.c:9:7: error: 'i' undeclared (first use in this function)
    9 |   for(i = 0;i<3;i++){
      |       ^
main.c:9:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

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

Compiler output:
a.cc:8:12: warning: missing terminating ' character
    8 |   if(s[0]=='1) a++;
      |            ^
a.cc:8:12: error: missing terminating ' character
    8 |   if(s[0]=='1) a++;
      |            ^~~~~~~~
a.cc:9:15: warning: missing terminating ' character
    9 |      if(s[1]=='1) a++;
      |               ^
a.cc:9:15: error: missing terminating ' character
    9 |      if(s[1]=='1) a++;
      |               ^~~~~~~~
a.cc:10:18: warning: missing terminating ' character
   10 |         if(s[2]=='1) a++;
      |                  ^
a.cc:10:18: error: missing terminating ' character
   10 |         if(s[2]=='1) a++;
      |                  ^~~~~~~~
a.cc: In function 'int main()':
a.cc:8:6: error: 's' was not declared in this scope
    8 |   if(s[0]=='1) a++;
      |      ^
a.cc:9:6: error: expected primary-expression before 'if'
    9 |      if(s[1]=='1) a++;
      |      ^~
a.cc:8:12: error: expected ')' before 'if'
    8 |   if(s[0]=='1) a++;
      |     ~      ^
      |            )
    9 |      if(s[1]=='1) a++;
      |      ~~
Language: C++

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

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

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

int main() {
  
int s x;  

  cin >> s;
  x = (s/10)%10 + s%2 + (s/100)%2;
  
  cout << x << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: expected initializer before 'x'
    6 | int s x;
      |       ^
a.cc:8:10: error: 's' was not declared in this scope
    8 |   cin >> s;
      |          ^
a.cc:9:3: error: 'x' was not declared in this scope
    9 |   x = (s/10)%10 + s%2 + (s/100)%2;
      |   ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: 'bc' was not declared in this scope; did you mean 'abc'?
    9 |   cout << (abc-bc)/100+(abc-a0c)/10+(abc-ab0)/1 << endl;
      |                ^~
      |                abc
a.cc:9:29: error: 'a0c' was not declared in this scope; did you mean 'abc'?
    9 |   cout << (abc-bc)/100+(abc-a0c)/10+(abc-ab0)/1 << endl;
      |                             ^~~
      |                             abc
a.cc:9:42: error: 'ab0' was not declared in this scope; did you mean 'abc'?
    9 |   cout << (abc-bc)/100+(abc-a0c)/10+(abc-ab0)/1 << endl;
      |                                          ^~~
      |                                          abc
Language: C++

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

Compiler output:
a.cc:1:1: error: 'nclude' does not name a type
    1 | nclude <bits/stdc++.h>
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> a >> b >> c;
      |   ^~~
a.cc:7:3: error: 'cout' was not declared in this scope
    7 |   cout << a + b +c << endl;
      |   ^~~~
a.cc:7:23: error: 'endl' was not declared in this scope
    7 |   cout << a + b +c << endl;
      |                       ^~~~
Language: C++

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: lvalue required as left operand of assignment
    8 |   if (s1 + s2 + s3 = 0) {
      |       ~~~~~~~~^~~~
a.cc:12:20: error: lvalue required as left operand of assignment
   12 |   else if (s1 + s2 + s3 = 1) {
      |            ~~~~~~~~^~~~
a.cc:16:20: error: lvalue required as left operand of assignment
   16 |   else if (s1 + s2 + s3 = 2) {
      |            ~~~~~~~~^~~~
a.cc:20:20: error: lvalue required as left operand of assignment
   20 |   else if (s1 + s2 + s3 = 3) {
      |            ~~~~~~~~^~~~
Language: Java

import java.util.Scanner;

public class MainA {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    String s = sc.next();

    String r = s.replaceAll("0", "");

    System.out.println(r.length());

  }

}

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

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

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

    #include<iostream>
    using namespace std;
    int main()
    {
        string s;
        int count = 0;
        cin >> s;
        for(int i =0; i < 3; i++){
            if(s[i] == '1') ++count

        }
        cout << count <<endl;
    }


Compiler output:
a.cc: In function 'int main()':
a.cc:9:36: error: expected ';' before '}' token
    9 |             if(s[i] == '1') ++count
      |                                    ^
      |                                    ;
   10 | 
   11 |         }
      |         ~
Language: C++

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

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

#include<stdio.h>
 
int main()
{
	int N,Max = 0,counter = 0;
	scanf("%d",&N);
	for(int i = 0;i < N;i++)
		int Ai;
		scanf("%d",&Ai);
		while(!(Ai % 2))
		{
			Ai /= 2;
			counter++;
		}
		if(Max < counter) Max = counter;
	}
	printf("%d",Max);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:29: error: 'Ai' was not declared in this scope
    9 |                 scanf("%d",&Ai);
      |                             ^~
a.cc: At global scope:
a.cc:17:15: error: expected constructor, destructor, or type conversion before '(' token
   17 |         printf("%d",Max);
      |               ^
a.cc:18:9: error: expected unqualified-id before 'return'
   18 |         return 0;
      |         ^~~~~~
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: Java

import java.io.*;

public class Main{
  public static void main(String[] args)throws IOException{
    BufferedReader br = new BufferedReader(
      new InputStreamReader(System.in));
    
    int number = Integer.parseInt(br.readLine());//数の個数
    String input = br.readLine();//数字の羅列
    int[] numbers = new int[number];//数字の配列
    
    //配列に数字を格納していく
    for(int i = 0; i<number - 1; i++){
      int space = input.indexOf(' ');
      numbers[i] = Integer.parseInt(input.substring(0, space));
      input = input.substring(space);
    }
    numbers[number - 1] = Integer.parseInt(input);
    
    //一つ目の数は何回２で割り切れるか？
    int minEven = 0;
    while(numbers[0] %2 == 0){
      numbers[0] = numbers[0] /2;
      minEven++;
    }
    //2つ目以降の数は1つ目より２で割り切れるか？
    for(int j = 0; j<length.numbers; j++){
      for(int i = 0; i < minEven; i++){
        if(numbers[j] % 2 != 0){
          minEven = i;
          break;
        }
        else{numbers[j] = numbers[j] /2;}
      }
    }
    System.out.println(minEven);
  }
}


Compiler output:
Main.java:27: error: cannot find symbol
    for(int j = 0; j<length.numbers; j++){
                     ^
  symbol:   variable length
  location: class Main
1 error
Language: C++

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

int main(){
  int i, sum=0;
  char a[3];
  for(i=0;i<3;i++){
  	cin >> a[i];
  	if(a[i] == 1){
    	sum++;
    }
  }
  cout << sum << endl;
  return 0;
}

Compiler output:
a.cc:2:9: fatal error: strings: No such file or directory
    2 | #include<strings>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

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

int main() {
  int a;
  cin >> a;
  amari10 = a % 10;
  amari100 = a % 100;
  amari1000 = a % 1000;
  ichi = amari10;
  juu = amari100 - amari10;
  hyaku = amari1000 - amari100;
  cout << ichi % 2 + juu % 2 + hyaku % 2 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'amari10' was not declared in this scope
    7 |   amari10 = a % 10;
      |   ^~~~~~~
a.cc:8:3: error: 'amari100' was not declared in this scope
    8 |   amari100 = a % 100;
      |   ^~~~~~~~
a.cc:9:3: error: 'amari1000' was not declared in this scope
    9 |   amari1000 = a % 1000;
      |   ^~~~~~~~~
a.cc:10:3: error: 'ichi' was not declared in this scope
   10 |   ichi = amari10;
      |   ^~~~
a.cc:11:3: error: 'juu' was not declared in this scope
   11 |   juu = amari100 - amari10;
      |   ^~~
a.cc:12:3: error: 'hyaku' was not declared in this scope
   12 |   hyaku = amari1000 - amari100;
      |   ^~~~~
Language: C++

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

int main() {
  int a;
  cin >> a;
  amari10 = a % 10;
  amari100 = a % 100;
  amari1000 = a % 1000;
  ichi = amari10;
  juu = amari100 - amari10;
  hyaku = amari1000 - amari100
  cout << ichi % 2 + juu % 2 + hyaku % 2 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'amari10' was not declared in this scope
    7 |   amari10 = a % 10;
      |   ^~~~~~~
a.cc:8:3: error: 'amari100' was not declared in this scope
    8 |   amari100 = a % 100;
      |   ^~~~~~~~
a.cc:9:3: error: 'amari1000' was not declared in this scope
    9 |   amari1000 = a % 1000;
      |   ^~~~~~~~~
a.cc:10:3: error: 'ichi' was not declared in this scope
   10 |   ichi = amari10;
      |   ^~~~
a.cc:11:3: error: 'juu' was not declared in this scope
   11 |   juu = amari100 - amari10;
      |   ^~~
a.cc:12:3: error: 'hyaku' was not declared in this scope
   12 |   hyaku = amari1000 - amari100
      |   ^~~~~
Language: Java

import java.io.*;
 
public class Main{
  public static void main(String[] args)throws IOException{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    
    String input = br.readLine();
    int zero = 0;
    for(int i = 0; i<input.length; i++){
      if(input.indexOf('0',i) == 0){
        zero++;
      }
    }
  }
}

Compiler output:
Main.java:9: error: cannot find symbol
    for(int i = 0; i<input.length; i++){
                          ^
  symbol:   variable length
  location: variable input of type String
1 error
Language: Java

import java.io.*;

public class Main{
  public static void main(String[] args)throws IOException{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    
    String input = br.readLine();
    int zero = 0;
    for(int i = 0; i<input.length; i++){
      if(input.indexOf('0',i){
        zero++;
      }
         }
         }
         }

Compiler output:
Main.java:10: error: ')' expected
      if(input.indexOf('0',i){
                             ^
1 error
Language: C++

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:9:29: error: expected ';' before '}' token
    9 |     if(s.at(i) == '1') ans++
      |                             ^
      |                             ;
   10 |   }
      |   ~
Language: C++

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

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


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

#include <iostream>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> vec(N);
  for(int i = 0; i < N; i++){
    cin >> vec.at(i);
  }
  
  int count = 0;
  bool odd_exist = false;
  while(odd_exist == false){
    for(int i = 0; i < N; i++){
      if(vec.at(i) % 2 == 1){
        odd_exist = true;
        break;
      }
      else{
        vec.at(i) /= 2;
      }
    }
    if(odd_exist == true){
      break;
    }
    count++;
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> vec(N);
      |   ^~~~~~
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:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> vec(N);
      |          ^~~
a.cc:9:12: error: 'vec' was not declared in this scope
    9 |     cin >> vec.at(i);
      |            ^~~
a.cc:16:10: error: 'vec' was not declared in this scope
   16 |       if(vec.at(i) % 2 == 1){
      |          ^~~
Language: C++

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

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

  
}


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

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

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

  
}


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

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

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

  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 'i' was not declared in this scope
    7 |   for(i=0;i<3;i++){
      |       ^
a.cc:14:6: error: expected ';' before '}' token
   14 | sum++
      |      ^
      |      ;
   15 | }
      | ~