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

#include <iostream>
#include <string>
#include <bits/stdc++.h>
 
namespace std;
 
int main() {
  string str;
  int sum = 0;
  cin >> str;
  for (int i = 0; i < 3; i++) {
	  sum = sum + stoi(str[i]);
  }
  cout << sum << endl;
}

Compiler output:
a.cc:5:14: error: expected '{' before ';' token
    5 | namespace std;
      |              ^
a.cc: In function 'int main()':
a.cc:8:3: error: 'string' was not declared in this scope
    8 |   string str;
      |   ^~~~~~
a.cc:8:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:10:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |   cin >> str;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:10: error: 'str' was not declared in this scope; did you mean 'std'?
   10 |   cin >> str;
      |          ^~~
      |          std
a.cc:12:23: error: 'stoi' was not declared in this scope; did you mean 'std::__cxx11::stoi'?
   12 |           sum = sum + stoi(str[i]);
      |                       ^~~~
      |                       std::__cxx11::stoi
In file included from /usr/include/c++/14/string:54:
/usr/include/c++/14/bits/basic_string.h:4432:3: note: 'std::__cxx11::stoi' declared here
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
a.cc:14:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |   cout << sum << 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:14:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 |   cout << sum << endl;
      |                  ^~~~
      |                  std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

//namespace std;

int main() {
  std::string str;
  int sum = 0;
  std::cin >> str;
  for (int i = 0; i < 3; i++) {
	  sum = sum + std::stoi(str[i]);
  }
  std::cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:32: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   11 |           sum = sum + std::stoi(str[i]);
      |                       ~~~~~~~~~^~~~~~~~
In file included from /usr/include/c++/14/string:54,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~
a.cc:13:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 |   std::cout << sum << endl;
      |                       ^~~~
      |                       std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
                 from a.cc:2:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <string>
#include <bits/stdc++.h>
 
int main() {
  string str;
  int sum = 0;
  cin >> str;
  for (int i = 0; i < 3; i++) {
	  sum = sum + std::stoi(str[i]);
  }
  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
    5 |   string str;
      |   ^~~~~~
a.cc:5:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> str;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:10: error: 'str' was not declared in this scope; did you mean 'std'?
    7 |   cin >> str;
      |          ^~~
      |          std
a.cc:11:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |   cout << sum << 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:11:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 |   cout << sum << endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <string>
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string str;
  int sum = 0;
  cin >> str;
  for (int i = 0; i < 3; i++) {
	  sum = sum + stoi(str[i]);
  }
  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:27: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   10 |           sum = sum + stoi(str[i]);
      |                       ~~~~^~~~~~~~
In file included from /usr/include/c++/14/string:54,
                 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 <string>
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string str;
  int sum = 0;
  cin >> str;
  for (int i = 0; i < 3; i++) {
	  sum = sum + std::stoi(str[i]);
  }
  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:32: error: no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   10 |           sum = sum + std::stoi(str[i]);
      |                       ~~~~~~~~~^~~~~~~~
In file included from /usr/include/c++/14/string:54,
                 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 <bits/stdc++.h>
using namespace std;

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

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

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

int main() {
  string a;
  int b;
  b=0;
  if (a.at(0)=="1") {
    b++;
  }
  if (a.at(1)=="1") {
    b++;
  }
  if (a.at(2)=="2") {
    b++;
  }
  cout << b <<endl;
}

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

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

int main() {
  string a;
  int b;
  b=0;
  if (a.at(0)="1") {
    b++;
  }
  if (a.at(1)="1") {
    b++;
  }
  if (a.at(2)="2") {
    b++;
  }
  cout << b <<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 (a.at(0)="1") {
      |               ^~~
      |               |
      |               const char*
a.cc:11:15: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   11 |   if (a.at(1)="1") {
      |               ^~~
      |               |
      |               const char*
a.cc:14:15: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   14 |   if (a.at(2)="2") {
      |               ^~~
      |               |
      |               const char*
Language: C++

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

int main() {
  int a;
  cin >> a;
  cout << a.at(0)+a.at(1)+a.at(2) <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: request for member 'at' in 'a', which is of non-class type 'int'
    7 |   cout << a.at(0)+a.at(1)+a.at(2) <<endl;
      |             ^~
a.cc:7:21: error: request for member 'at' in 'a', which is of non-class type 'int'
    7 |   cout << a.at(0)+a.at(1)+a.at(2) <<endl;
      |                     ^~
a.cc:7:29: error: request for member 'at' in 'a', which is of non-class type 'int'
    7 |   cout << a.at(0)+a.at(1)+a.at(2) <<endl;
      |                             ^~
Language: C++

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

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

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

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

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



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

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

typedef unsigned long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev

#define INF (int)(1e9)

#define rep(i,n) for(int i=0; i<(n); ++i)
#define REP(i,start,end) for(int i=(start);i<=(end);++i)
#define all(n) begin(n),end(n)

#define DEBUG

int main()
{
	ios::sync_with_stdio(false); cin.tie(0);
	string s;
	int ans = 0;
	rep(i,3)
	{
		if(s[i] == '1') ans++;
	}

	cout << ans << endl;
	return 0;
}

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:52: error: expected '}' at end of input
    7 |   cout << num/100%10 + num/10%10 + num%10  << endl;
      |                                                    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String a = sc.next();
    String b = a;
    String n;
    int len;
    int lenans = 4;
    int i = 1;
    n = String.valueOf(i);
    b = a.replace(n,"");
    len = b.length();
    if(len < lenans){
        lenans = len;
      }
    b = a;
    }
    System.out.println(3-lenans);
  }
}


Compiler output:
Main.java:19: error: <identifier> expected
    System.out.println(3-lenans);
                      ^
Main.java:19: error: illegal start of type
    System.out.println(3-lenans);
                       ^
Main.java:21: error: class, interface, enum, or record expected
}
^
3 errors
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: invalid operands of types 'const char [3]' and 'const char [3]' to binary 'operator+'
    7 |   cout << "s1"+"s2"+"s3" << endl;
      |           ~~~~^~~~~
      |           |    |
      |           |    const char [3]
      |           const char [3]
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: invalid operands of types 'const char [3]' and 'const char [3]' to binary 'operator+'
    6 |   cin >> "s1"+"s2"+"s3";
      |          ~~~~^~~~~
      |          |    |
      |          |    const char [3]
      |          const char [3]
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: storage size of 's1' isn't known
    5 |   char s1[],s2[],s3[];
      |        ^~
a.cc:5:13: error: storage size of 's2' isn't known
    5 |   char s1[],s2[],s3[];
      |             ^~
a.cc:5:18: error: storage size of 's3' isn't known
    5 |   char s1[],s2[],s3[];
      |                  ^~
a.cc:6:14: error: invalid operands of types 'const char [3]' and 'const char [3]' to binary 'operator+'
    6 |   cin >> "s1"+"s2"+"s3";
      |          ~~~~^~~~~
      |          |    |
      |          |    const char [3]
      |          const char [3]
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:6:14: error: invalid operands of types 'const char [3]' and 'const char [3]' to binary 'operator+'
    6 |   cin >> "s1"+"s2"+"s3";
      |          ~~~~^~~~~
      |          |    |
      |          |    const char [3]
      |          const char [3]
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: invalid operands of types 'const char [3]' and 'const char [3]' to binary 'operator+'
    6 |   cin >> "s1"+"s2"+"s3";
      |          ~~~~^~~~~
      |          |    |
      |          |    const char [3]
      |          const char [3]
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:48: error: expected ';' before ')' token
    7 |   cout << a%2 + (a-a%2)/10 %2 +((a-a%2)/10)-a%2)/10 %2 << endl;
      |                                                ^
      |                                                ;
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: expected initializer before 'int'
    5 |   int c=0;
      |   ^~~
a.cc:6:8: error: 's' was not declared in this scope
    6 |   cin>>s;
      |        ^
a.cc:7:17: error: 'c' was not declared in this scope
    7 |   if(s[0]=='1') c++;
      |                 ^
a.cc:8:17: error: 'c' was not declared in this scope
    8 |   if(s[1]=='1') c++;
      |                 ^
a.cc:9:17: error: 'c' was not declared in this scope
    9 |   if(s[2]=='1') c++;
      |                 ^
a.cc:10:9: error: 'c' was not declared in this scope
   10 |   cout<<c;
      |         ^
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] argas){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int count = 0;
    if(a / 100 / 2 == 1) count++;
    if(a / 10 / 2 == 1) count++;
    if ( a / 2) count++;
    System.out.println(count);
  }
}


Compiler output:
Main.java:9: error: incompatible types: int cannot be converted to boolean
    if ( a / 2) count++;
           ^
1 error
Language: C++

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

int main() {
  int a;
  cin >> a;
  if(a == 0){
    cout << 0 << endl;
  }
  else if(a==1 || a==10 || a==100){
    cout << 1 << endl;
  }
  else if(a==11 || a==101 || ==110){
    cout << 2 << endl;
  }
  else{
    cout << 3 << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:30: error: expected primary-expression before '==' token
   13 |   else if(a==11 || a==101 || ==110){
      |                              ^~
Language: C++

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

int main(){
    string s;

    cin >> s;
    
    int counter=0;
    const int NUM=3;
    for (int i=0; i<NUM; i++){
        if (s[i]=="1"){
            counter++;
        }
    }

    cout << counter <<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |         if (s[i]=="1"){
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 - a/100 * 10) * 10<< endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'cin'
    6 |   cin >> a;
      |   ^~~
a.cc:7:11: error: 'a' was not declared in this scope
    7 |   cout << a/100 + a/10 - a/100 * 10 + a - a/100 * 100 - (a/10 - a/100 * 10) * 10<< endl;
      |           ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: expected ';' before numeric constant
    7 |   cout<< s/100+(s+1)1-1+(s+10)/10-1<< endl;
      |                     ^
      |                     ;
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 num = 0;
      	for (int i=0; i<s.length(); i++){
        	if(s.charAt(i)=='1') num++
        }
      	System.out.println(num);
    }
}

Compiler output:
Main.java:8: error: ';' expected
        	if(s.charAt(i)=='1') num++
        	                          ^
1 error
Language: Java

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

Compiler output:
Main.java:5: error: incompatible types: possible lossy conversion from int to char
      	char s1 = sc.nextInt();
      	                    ^
Main.java:6: error: incompatible types: possible lossy conversion from int to char
      	char s2 = sc.nextInt();
      	                    ^
Main.java:7: error: incompatible types: possible lossy conversion from int to char
        char s3 = sc.nextInt();
                            ^
Main.java:9: error: variable s is already defined in method main(String[])
		String s = s1 + s2 + s3;
		       ^
Main.java:9: error: incompatible types: int cannot be converted to String
		String s = s1 + s2 + s3;
		                   ^
5 errors
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      	char s1 = sc.nextInt();
      	char s2 = sc.nextInt();
        char s3 = sc.nextInt();
      	String s = sc.next();
        String s = s1+s2+s3;
      	int counter == 0;
      	if(s1=='1'){
        	counter += 1;
        }
      	if(s2=='1'){
        	counter += 1;
        }
      	if(s3=='1'){
        	counter += 1;
        }
      	System.out.println(counter);
    }
}

Compiler output:
Main.java:10: error: ';' expected
      	int counter == 0;
      	           ^
1 error
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      	char s1 = sc.nextInt();
      	char s2 = sc.nextInt();
        char s3 = sc.nextInt();
      	String s = sc.next();
      	int counter == 0;
      	if(s1=='1'){
        	counter += 1;
        }
      	if(s2=='1'){
        	counter += 1;
        }
      	if(s3=='1'){
        	counter += 1;
        }
      	String s = 's1'+'s2'+'s3';
        long counter = s.chars().filter(ch -> ch == '1').count();
      	System.out.println(counter);
    }
}

Compiler output:
Main.java:9: error: ';' expected
      	int counter == 0;
      	           ^
Main.java:19: error: unclosed character literal
      	String s = 's1'+'s2'+'s3';
      	           ^
Main.java:19: error: not a statement
      	String s = 's1'+'s2'+'s3';
      	                 ^
Main.java:19: error: ';' expected
      	String s = 's1'+'s2'+'s3';
      	                   ^
Main.java:19: error: unclosed character literal
      	String s = 's1'+'s2'+'s3';
      	                        ^
Main.java:19: error: not a statement
      	String s = 's1'+'s2'+'s3';
      	                      ^
6 errors
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      	char s1 = sc.nextInt();
      	char s2 = sc.nextInt();
      	char s3 = sc.nextInt();
      	int counter == 0;
      	if(s1=='1'){
        	counter += 1;
        }else if(s2=='1'){
        	counter += 1;
        }else if(s3=='1'){
        	counter += 1;
        }
      	s = 's1'+'s2'+'s3';
      	count(1) == counter;
      	System.out.println(counter);
      	
        } 
    }
}

Compiler output:
Main.java:8: error: ';' expected
      	int counter == 0;
      	           ^
Main.java:16: error: unclosed character literal
      	s = 's1'+'s2'+'s3';
      	    ^
Main.java:16: error: not a statement
      	s = 's1'+'s2'+'s3';
      	          ^
Main.java:16: error: ';' expected
      	s = 's1'+'s2'+'s3';
      	            ^
Main.java:16: error: unclosed character literal
      	s = 's1'+'s2'+'s3';
      	                 ^
Main.java:16: error: not a statement
      	s = 's1'+'s2'+'s3';
      	               ^
Main.java:17: error: not a statement
      	count(1) == counter;
      	         ^
Main.java:22: error: class, interface, enum, or record expected
}
^
8 errors
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      	int s1 = sc.nextInt();
      	int s2 = sc.nextInt();
      	int s3 = sc.nextInt();
      	int counter == 0;
      	if(s1==1){
        	counter 1++;
        }else if(s2==1){
        	counter 1++;
        }else if(s3==1){
        	counter 1++;
        }
      	System.out.println(counter);
      	
        } 
    }
}

Compiler output:
Main.java:8: error: ';' expected
      	int counter == 0;
      	           ^
Main.java:10: error: not a statement
        	counter 1++;
        	^
Main.java:10: error: ';' expected
        	counter 1++;
        	       ^
Main.java:12: error: not a statement
        	counter 1++;
        	^
Main.java:12: error: ';' expected
        	counter 1++;
        	       ^
Main.java:14: error: not a statement
        	counter 1++;
        	^
Main.java:14: error: ';' expected
        	counter 1++;
        	       ^
Main.java:20: error: class, interface, enum, or record expected
}
^
8 errors
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      	int s1 = sc.nextInt();
      	int s2 = sc.nextInt();
      	int s3 = sc.nextInt();
      	int counter == 0;
      	if(s1==1){
        	counter += 1;
        }else if(s2==1){
        	counter += 1;
        }else if(s3==1){
        	counter += 1;
        }
      	System.out.println(counter);
      	
        } 
    }
}

Compiler output:
Main.java:8: error: ';' expected
      	int counter == 0;
      	           ^
Main.java:20: error: class, interface, enum, or record expected
}
^
2 errors
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      	int s1 = sc.nextInt();
      	int s2 = sc.nextInt();
      	int s3 = sc.nextInt();
      	if(s1==1){
        	counter += 1;
        }else if(s2==1){
        	counter += 1;
        }else if(s3==1){
        	counter += 1;
        }
      	System.out.println(counter);
      	
        } 
    }
}

Compiler output:
Main.java:19: error: class, interface, enum, or record expected
}
^
1 error
Language: Java

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

Compiler output:
Main.java:8: error: illegal start of expression
      	[s1,s2,s3] == [0,0,0],[1,0,0],[0,1,0],[0,0,1],[1,1,0],[1,0,1],[0,1,1],[1,1,1]
      	^
Main.java:8: error: not a statement
      	[s1,s2,s3] == [0,0,0],[1,0,0],[0,1,0],[0,0,1],[1,1,0],[1,0,1],[0,1,1],[1,1,1]
      	 ^
Main.java:8: error: ';' expected
      	[s1,s2,s3] == [0,0,0],[1,0,0],[0,1,0],[0,0,1],[1,1,0],[1,0,1],[0,1,1],[1,1,1]
      	   ^
Main.java:8: error: not a statement
      	[s1,s2,s3] == [0,0,0],[1,0,0],[0,1,0],[0,0,1],[1,1,0],[1,0,1],[0,1,1],[1,1,1]
      	    ^
Main.java:8: error: ';' expected
      	[s1,s2,s3] == [0,0,0],[1,0,0],[0,1,0],[0,0,1],[1,1,0],[1,0,1],[0,1,1],[1,1,1]
      	      ^
Main.java:8: error: not a statement
      	[s1,s2,s3] == [0,0,0],[1,0,0],[0,1,0],[0,0,1],[1,1,0],[1,0,1],[0,1,1],[1,1,1]
      	       ^
Main.java:8: error: ';' expected
      	[s1,s2,s3] == [0,0,0],[1,0,0],[0,1,0],[0,0,1],[1,1,0],[1,0,1],[0,1,1],[1,1,1]
      	         ^
Main.java:13: error: class, interface, enum, or record expected
}
^
8 errors
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: expected ';' before 's2'
    7 |   s1 = S/100
      |             ^
      |             ;
    8 |   s2 = (S-s1*100)/10
      |   ~~
Language: C++

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

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

#include "stdio.h"

int main(){
  	
  char str[4];
   int ret = scanf("%s", str);
  int count = 0;

  for(int ii=0;ii<4;ii++){
   	if(str[ii] == '1'){
   	  count++;
   	}
  }
  printf("%d",count);
    
	return 0; 
}#include "stdio.h"

int main(){
  	
  char str[4];
   int ret = scanf("%s", str);
  int count = 0;

  for(int ii=0;ii<4;ii++){
   	if(str[ii] == '1'){
   	  count++;
   	}
  }
  printf("%d",count);
    
	return 0; 
}

Compiler output:
a.cc:17:2: error: stray '#' in program
   17 | }#include "stdio.h"
      |  ^
a.cc:17:3: error: 'include' does not name a type
   17 | }#include "stdio.h"
      |   ^~~~~~~
Language: C++

#include<iostream>
using namespace std;

int main(void){
  string a;
  int b=0;
  cin >> a;
  if (a[0]=="1") ans++;
  if (a[1]=="1") ans++;
  if (a[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 (a[0]=="1") ans++;
a.cc:8:18: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |   if (a[0]=="1") ans++;
      |                  ^~~
      |                  abs
a.cc:9:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |   if (a[1]=="1") ans++;
a.cc:9:18: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |   if (a[1]=="1") ans++;
      |                  ^~~
      |                  abs
a.cc:10:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |   if (a[2]=="1") ans++;
a.cc:10:18: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |   if (a[2]=="1") ans++;
      |                  ^~~
      |                  abs
a.cc:11:11: 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 s1s2s3;
  cin >> s1s2s3;
  s1s2s3 = s1 * 100 + s2 * 10 + s3;
  cout << s1 + s2 + s3 << endl;
}


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: 's1' was not declared in this scope; did you mean 'y1'?
    7 |   cout << s1 + s2 + s3 << endl;
      |           ^~
      |           y1
a.cc:7:16: error: 's2' was not declared in this scope
    7 |   cout << s1 + s2 + s3 << endl;
      |                ^~
a.cc:7:21: error: 's3' was not declared in this scope
    7 |   cout << s1 + s2 + s3 << endl;
      |                     ^~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'b' was not declared in this scope
    8 |     b = 3;
      |     ^
a.cc:10:5: error: 'b' was not declared in this scope
   10 |     b = a % 3;
      |     ^
a.cc:12:11: error: 'b' was not declared in this scope
   12 |   cout >> b >> endl;
      |           ^
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 cnt = 0;
      	int n = s.length();
      	for (int i = 0; i < n; i++) {
        	if (s.charAt(i) == '1') {
            	cnt++;
            }
        }
      System.out.println(cnt);
    }

Compiler output:
Main.java:14: error: reached end of file while parsing
    }
     ^
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 cnt = 0;
      	for (int i = 0; i < s.length; i++) {
        	if (s.charAt(i) == '1') {
            	cnt++;
            }
        }
      System.out.println(cnt);
    }
}

Compiler output:
Main.java:7: error: cannot find symbol
      	for (int i = 0; i < s.length; i++) {
      	                     ^
  symbol:   variable length
  location: variable s of type String
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 cnt = 0;
      	for (i = 0; i < s.length; i++) {
        	if (s.charAt(i) == '1') {
            	cnt++;
            }
        }
    }
}

Compiler output:
Main.java:7: error: cannot find symbol
      	for (i = 0; i < s.length; i++) {
      	     ^
  symbol:   variable i
  location: class Main
Main.java:7: error: cannot find symbol
      	for (i = 0; i < s.length; i++) {
      	            ^
  symbol:   variable i
  location: class Main
Main.java:7: error: cannot find symbol
      	for (i = 0; i < s.length; i++) {
      	                 ^
  symbol:   variable length
  location: variable s of type String
Main.java:7: error: cannot find symbol
      	for (i = 0; i < s.length; i++) {
      	                          ^
  symbol:   variable i
  location: class Main
Main.java:8: error: cannot find symbol
        	if (s.charAt(i) == '1') {
        	             ^
  symbol:   variable i
  location: class Main
5 errors
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:22: error: expected ')' before ';' token
    6 |   for(int i=0;i++;i<3;){
      |      ~               ^
      |                      )
a.cc:6:23: error: expected primary-expression before ')' token
    6 |   for(int i=0;i++;i<3;){
      |                       ^
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
     	int s1 = sc.nextInt();
      	int s2 = sc.nextInt();
      	int s3 = sc.nextInt();
      	System.out.pritln(s1+s2+s3);
    }
}

Compiler output:
Main.java:8: error: cannot find symbol
      	System.out.pritln(s1+s2+s3);
      	          ^
  symbol:   method pritln(int)
  location: variable out of type PrintStream
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
    string S;
    int sum;
    for(int i=0; i<S.length(); i++){
       if(S[i] == "1"){
          sum++; 
       }
    }
    cout << sum;
}


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

class Main{
  public static void main(String[] args){
    Scanner sin = new Scanner(System.in);
    int s1 = sin.nextInt();
    int s2 = sin.nextInt();
    int s3 = sin.nextInt();
    int[] s = {s1,s2,s3};
    int count = 0;
    for(int i = 0;i <= s.length;i++){
      if(s[i] == 1){
        count += 1; 
      }  
    }
    System.out.println(count);
  }  
}  

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

import java.util.Scanner;

class Main{
  public static void main(String[] args){
    Scanner sin = new Scanner(System.in);
    int s1 = sin.nextInt();
    int s2 = sin.nextInt();
    int s3 = sin.nextInt();
    int[] s = {s1,s2,s3};
    for(int i = 0;i <= s.length;i++){
      if(s[i] == 1){
        int count += 1; 
      }  
    }
    System.out.println(count);
  }  
}  

Compiler output:
Main.java:12: error: ';' expected
        int count += 1; 
                 ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s;
  int count = 0;
  cin >> s;
  for(int i = 0; i < 3; i++){
  if(s[i] == "1"){
      count += 1;
    }
  }
  cout << count << 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[i] == "1"){
Language: C++

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: expected ';' before '}' token
   10 |       count += 1
      |                 ^
      |                 ;
   11 |     }
      |     ~            
a.cc:13:2: error: expected '}' at end of input
   13 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <algorithm>
#include <string> 
#include <math.h>
#include <set>
#include <vector>
#define rep(i,n) for(int i=0; i< (int)(n); ++i)
using namespace std;


int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
    
    string s;
    cin >> s;
    cout << accumulate(s.begin(), s.end(), 0) - '0' << "\n";
    
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: 'accumulate' was not declared in this scope
   17 |     cout << accumulate(s.begin(), s.end(), 0) - '0' << "\n";
      |             ^~~~~~~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: expected primary-expression before '==' token
    8 |   if(s[0]=='1')==ans++;
      |                ^~
a.cc:9:16: error: expected primary-expression before '==' token
    9 |   if(s[1]=='1')==ans++;
      |                ^~
a.cc:10:16: error: expected primary-expression before '==' token
   10 |   if(s[2]=='1')==ans++;
      |                ^~
Language: C++

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

int main(){
  int ans;
  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:6:6: error: 's' was not declared in this scope
    6 |   if(s[0]=='1')==ans++;
      |      ^
a.cc:6:16: error: expected primary-expression before '==' token
    6 |   if(s[0]=='1')==ans++;
      |                ^~
a.cc:7:6: error: 's' was not declared in this scope
    7 |   if(s[1]=='1')==ans++;
      |      ^
a.cc:7:16: error: expected primary-expression before '==' token
    7 |   if(s[1]=='1')==ans++;
      |                ^~
a.cc:8:6: error: 's' was not declared in this scope
    8 |   if(s[2]=='1')==ans++;
      |      ^
a.cc:8:16: error: expected primary-expression before '==' token
    8 |   if(s[2]=='1')==ans++;
      |                ^~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:13: error: conflicting declaration 'int s [1]'
    5 |   int s[0], s[1], s[2];
      |             ^
a.cc:5:7: note: previous declaration as 'int s [0]'
    5 |   int s[0], s[1], s[2];
      |       ^
a.cc:5:19: error: conflicting declaration 'int s [2]'
    5 |   int s[0], s[1], s[2];
      |                   ^
a.cc:5:7: note: previous declaration as 'int s [0]'
    5 |   int s[0], s[1], s[2];
      |       ^
Language: C++

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

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


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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: expected '}' at end of input
   15 |   cout << c << endl;
      |                     ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

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

using namespace std;

int main() {
    int N;
    int A[200] = { 0 };
    
    cin >> N;
    for (auto i = 0; i < N; ++i) cin >> A[i];

    int tmp[200], result[200];
    memcpy(tmp, A, sizeof(A));

    bool isFinish = false;
    int count = 0;
    while (!isFinish) {
        memcpy(result, tmp, sizeof(tmp));
        for (int i = 0; i < N; ++i) {
            if (result[i] % 2 == 1) {
                isFinish = true;
                break;
            }
            tmp[i] = result[i] / 2;
        }
        ++count;
    }
    // 最後に余分に回った分を減らしておく
    --count;

    cout << count << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'memcpy' was not declared in this scope
   16 |     memcpy(tmp, A, sizeof(A));
      |     ^~~~~~
a.cc:4:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <vector>
  +++ |+#include <cstring>
    4 | #include <stdio.h>
Language: C++

#include <iostream>
#include  <string>

int counter = 0;
std::string s;
std::cin>>s;

if(s[0]=='1'){
    ++counter;
}
if(s[1]=='1'){
    ++counter;
}
if(s[2]=='1'){
    ++counter;
}

std::cout<<counter<<std::endl;


Compiler output:
a.cc:6:6: error: 'cin' in namespace 'std' does not name a type
    6 | std::cin>>s;
      |      ^~~
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:8:1: error: expected unqualified-id before 'if'
    8 | if(s[0]=='1'){
      | ^~
a.cc:11:1: error: expected unqualified-id before 'if'
   11 | if(s[1]=='1'){
      | ^~
a.cc:14:1: error: expected unqualified-id before 'if'
   14 | if(s[2]=='1'){
      | ^~
a.cc:18:6: error: 'cout' in namespace 'std' does not name a type
   18 | std::cout<<counter<<std::endl;
      |      ^~~~
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>
#incude  <string>

int counter = 0;
std::string s;
std::cin>>s;

if(s[0]=='1'){
    ++counter;
}
if(s[1]=='1'){
    ++counter;
}
if(s[2]=='1'){
    ++counter;
}

std::cout<<counter<<std::endl;


Compiler output:
a.cc:2:2: error: invalid preprocessing directive #incude; did you mean #include?
    2 | #incude  <string>
      |  ^~~~~~
      |  include
a.cc:6:6: error: 'cin' in namespace 'std' does not name a type
    6 | std::cin>>s;
      |      ^~~
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:8:1: error: expected unqualified-id before 'if'
    8 | if(s[0]=='1'){
      | ^~
a.cc:11:1: error: expected unqualified-id before 'if'
   11 | if(s[1]=='1'){
      | ^~
a.cc:14:1: error: expected unqualified-id before 'if'
   14 | if(s[2]=='1'){
      | ^~
a.cc:18:6: error: 'cout' in namespace 'std' does not name a type
   18 | std::cout<<counter<<std::endl;
      |      ^~~~
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iosteram>
#incude  <string>

int counter = 0;
std::string s;
std::cin>>s;

if(s[0]=='1'){
    ++counter;
}
if(s[1]=='1'){
    ++counter;
}
if(s[2]=='1'){
    ++counter;
}

std::cout<<counter<<std::endl;


Compiler output:
a.cc:1:10: fatal error: iosteram: No such file or directory
    1 | #include <iosteram>
      |          ^~~~~~~~~~
compilation terminated.