criyle/codenet-compile-errors huggingface dataset:
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:10:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |   if (s[0] == "1") ans++;
a.cc:11:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |   if (s[1] == "1") ans++;
a.cc:12:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   if (s[2] == "1") ans++;
Language: C++

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

  int ans = 0;
  for (int i = 0; i < 3; i++) {
  	if (s === "1") ans++;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: expected primary-expression before '=' token
   10 |         if (s === "1") ans++;
      |                 ^
Language: C++

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

  int ans = 0;
  for (int i = 0; i < 3; i++) {
  	if (s = '1') ans++;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(49)' from 'std::__cxx11::basic_string<char>' to 'bool'
   10 |         if (s = '1') ans++;
      |             ~~^~~~~
      |               |
      |               std::__cxx11::basic_string<char>
Language: C++

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

  if (s === "111") {
  cout << 3 << endl;
 } else {
cout << s%3 << endl;
}

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

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

int main(){
  string a;
  int c == 0;
  if(a[1]==1){
    c++;
  }
  if(a[2]==1){
    c++;
  }
  if(a[3]==1){
    c++;
  }
  cout << c << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: expected initializer before '==' token
    6 |   int c == 0;
      |         ^~
a.cc:8:5: error: 'c' was not declared in this scope
    8 |     c++;
      |     ^
a.cc:11:5: error: 'c' was not declared in this scope
   11 |     c++;
      |     ^
a.cc:14:5: error: 'c' was not declared in this scope
   14 |     c++;
      |     ^
a.cc:16:11: error: 'c' was not declared in this scope
   16 |   cout << c << endl;
      |           ^
Language: C++

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

int main(){
  string a;
  int c == 0;
  if(a[1]==1){
    c++;
  }
  if(a[2]==1){
    c++;
  }
  if(a[3]==1){
    c++;
  }
  cout << c << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: expected initializer before '==' token
    6 |   int c == 0;
      |         ^~
a.cc:8:5: error: 'c' was not declared in this scope
    8 |     c++;
      |     ^
a.cc:11:5: error: 'c' was not declared in this scope
   11 |     c++;
      |     ^
a.cc:14:5: error: 'c' was not declared in this scope
   14 |     c++;
      |     ^
a.cc:16:11: error: 'c' was not declared in this scope
   16 |   cout << c << endl;
      |           ^
a.cc:16:21: error: expected '}' at end of input
   16 |   cout << c << endl;
      |                     ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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

int main(){
  int Sa;
  (0<=Sa<=111;
  cin >> Sa;
  int Ssum=Sa/9;
  cout << Ssum << endl;
}
   

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: expected ')' before ';' token
    6 |   (0<=Sa<=111;
      |   ~          ^
      |              )
Language: C++

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

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

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

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

int main() {
  int S1, S2, S3;
  (0<=S1, S2, S3<=1);
  cin >> S1S2S3;
  cout << S1+S2+S3 << endl;
}


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

#include<iostream>
using namespace std;
int N;
int A[200];
int i=0;
int main(){
  cin>>N;for(i=0;i<N;i++)cin>>A[i];
  int res=0;
  bool flag = false;
  while(true){for(i=0;i<N;i++){if(A[i]%2!=0)flag = true;}if(!flag){for(j=0;j<N;j++)A[j]/=2;res++;}else break;}
  cout<<res<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:72: error: 'j' was not declared in this scope
   10 |   while(true){for(i=0;i<N;i++){if(A[i]%2!=0)flag = true;}if(!flag){for(j=0;j<N;j++)A[j]/=2;res++;}else break;}
      |                                                                        ^
Language: C++

#include<iostream>
using namespace std;
int N;
int A[200];
int main(){
  cin>>N;for(int i=0;i<N;i++)cin>>A[i];
  int res=0;
  while(true){for(i=0;i<N;i++)if(A[i]%2==1)break;else A[i]/=2;res++}
  cout<<res<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: 'i' was not declared in this scope
    8 |   while(true){for(i=0;i<N;i++)if(A[i]%2==1)break;else A[i]/=2;res++}
      |                   ^
a.cc:8:68: error: expected ';' before '}' token
    8 |   while(true){for(i=0;i<N;i++)if(A[i]%2==1)break;else A[i]/=2;res++}
      |                                                                    ^
      |                                                                    ;
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
    string s;
    scanf_s("%s", s, 3);
    int cnt = 0;
    if(s[0]=='1')cnt++;if(s[1]=='1')cnt++;if(s[2]=='1')cnt++;
    printf("%d\n", cnt)
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    6 |     scanf_s("%s", s, 3);
      |     ^~~~~~~
      |     scanf
a.cc:9:24: error: expected ';' before '}' token
    9 |     printf("%d\n", cnt)
      |                        ^
      |                        ;
   10 | }
      | ~
Language: C++

#include<iostream>
#include<cstdio>
#include<string>
using namespace std;
int main(){
    string s;
    scanf("%s", s);
    int cnt = 0;
    if(s[0]=='1')cnt++;if(s[1]=='1')cnt++;if(s[2]=='1')cnt++;
    printf("%d\n", cnt)
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: expected ';' before '}' token
   10 |     printf("%d\n", cnt)
      |                        ^
      |                        ;
   11 | }
      | ~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
    string s;
    scanf("%s", s);
    int cnt = 0;
    if(s[0]=='1')cnt++;if(s[1]=='1')cnt++;if(s[2]=='1')cnt++;
    printf("%d\n", cnt)
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: expected ';' before '}' token
    9 |     printf("%d\n", cnt)
      |                        ^
      |                        ;
   10 | }
      | ~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main(){
    string s;
    scanf("%s", s);
    int cnt = 0;
    if(s[0]=="1")cnt++;if(s[1]=="1")cnt++;if(s[2]=="1")cnt++;
    printf("%d\n", cnt)
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |     if(s[0]=="1")cnt++;if(s[1]=="1")cnt++;if(s[2]=="1")cnt++;
a.cc:8:31: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |     if(s[0]=="1")cnt++;if(s[1]=="1")cnt++;if(s[2]=="1")cnt++;
a.cc:8:50: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |     if(s[0]=="1")cnt++;if(s[1]=="1")cnt++;if(s[2]=="1")cnt++;
a.cc:9:24: error: expected ';' before '}' token
    9 |     printf("%d\n", cnt)
      |                        ^
      |                        ;
   10 | }
      | ~
Language: C++

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

int main() {
  int M, a, b, c, d, e, f ;
  cin >> M ;
  a = M / 100
  b = (M+90) / 100
  c = b - a
  d = (M+9) / 10
  e = M / 10
  f = d - e
  cout << a + c + f << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: expected ';' before 'b'
    7 |   a = M / 100
      |              ^
      |              ;
    8 |   b = (M+90) / 100
      |   ~
Language: C++

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

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

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

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int input, sum;
  cin >> input;
  // 各桁の数字を取る。
  sum += input / 100; //100の位
  input = input % 100;
  sum +=  input / 10;
  input = input % 10;
  sum += input 
  cout << input << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: expected ';' before 'cout'
   12 |   sum += input
      |               ^
      |               ;
   13 |   cout << input << endl;
      |   ~~~~
Language: C++

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


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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: invalid types 'int[int]' for array subscript
    8 | if(s[0]=='1')t++;
      |     ^
a.cc:9:5: error: invalid types 'int[int]' for array subscript
    9 | if(s[1]=='1')t++;
      |     ^
a.cc:10:5: error: invalid types 'int[int]' for array subscript
   10 | if(s[2]=='1')t++;
      |     ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: invalid types 'int[int]' for array subscript
    8 | if(s[0]==1)t++;
      |     ^
a.cc:9:5: error: invalid types 'int[int]' for array subscript
    9 | if(s[1]==1)t++;
      |     ^
a.cc:10:5: error: invalid types 'int[int]' for array subscript
   10 | if(s[2]==1)t++;
      |     ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: 's' was not declared in this scope
    7 | cin >> s;
      |        ^
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: expected '(' before '{' token
    7 |         if {
      |            ^
      |            (
Language: C++

#include <iostream>
using namespace std;

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


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:6: error: invalid cast from type 'std::__cxx11::basic_string<char>' to type 'int'
    8 |   x =int(s1 + s2 + s3);
      |      ^~~~~~~~~~~~~~~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:6: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
    8 |   x =int(s1) + int(s2) + int(s3);
      |      ^~~~~~~
a.cc:8:16: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
    8 |   x =int(s1) + int(s2) + int(s3);
      |                ^~~~~~~
a.cc:8:26: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
    8 |   x =int(s1) + int(s2) + int(s3);
      |                          ^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int ctoi(char c) {
	if (c == '1') {
		return 1;
	}
	return 0;
}

int main() {
  str s[3] = "000";
  cin >> s;

  int x;
  x = ctoi(s[0])+ctoi(s[1])+ctoi(s[2]);
  cout << x << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'str' was not declared in this scope; did you mean 'std'?
   12 |   str s[3] = "000";
      |   ^~~
      |   std
a.cc:13:10: error: 's' was not declared in this scope
   13 |   cin >> s;
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int ctoi(char c) {
	if (c == '1') {
		return 1;
	}
	return 0;
}

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

  int x;
  x = ctoi(s[0])+ctoi(s[1])+ctoi(s[2]);
  cout << x << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: invalid types 'char[int]' for array subscript
   16 |   x = ctoi(s[0])+ctoi(s[1])+ctoi(s[2]);
      |             ^
a.cc:16:24: error: invalid types 'char[int]' for array subscript
   16 |   x = ctoi(s[0])+ctoi(s[1])+ctoi(s[2]);
      |                        ^
a.cc:16:35: error: invalid types 'char[int]' for array subscript
   16 |   x = ctoi(s[0])+ctoi(s[1])+ctoi(s[2]);
      |                                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int ctoi(char c) {
	if (c == '1') {
		return 1;
	}
	return 0;
}

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

  int x = ctoi(s[0])+ctoi(s[1])+ctoi(s[2]);
  cout << x << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: invalid types 'char[int]' for array subscript
   15 |   int x = ctoi(s[0])+ctoi(s[1])+ctoi(s[2]);
      |                 ^
a.cc:15:28: error: invalid types 'char[int]' for array subscript
   15 |   int x = ctoi(s[0])+ctoi(s[1])+ctoi(s[2]);
      |                            ^
a.cc:15:39: error: invalid types 'char[int]' for array subscript
   15 |   int x = ctoi(s[0])+ctoi(s[1])+ctoi(s[2]);
      |                                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int ctoi(char c) {
	if (c == '1') {
		return 1;
	}
	return 0;
}

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

  int x = ctoi(s[0])+ctoi(s[1])+ctoi(s[2])
  cout << x << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: invalid types 'char[int]' for array subscript
   15 |   int x = ctoi(s[0])+ctoi(s[1])+ctoi(s[2])
      |                 ^
a.cc:15:28: error: invalid types 'char[int]' for array subscript
   15 |   int x = ctoi(s[0])+ctoi(s[1])+ctoi(s[2])
      |                            ^
a.cc:15:39: error: invalid types 'char[int]' for array subscript
   15 |   int x = ctoi(s[0])+ctoi(s[1])+ctoi(s[2])
      |                                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int ctoi(char c) {
	if (c == '1') {
		return 1;
	}
	return 0;
}

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

  x = ctoi(s[0])+ctoi(s[1])+ctoi(s[2])
  cout << x << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: 'x' was not declared in this scope
   15 |   x = ctoi(s[0])+ctoi(s[1])+ctoi(s[2])
      |   ^
a.cc:15:13: error: invalid types 'char[int]' for array subscript
   15 |   x = ctoi(s[0])+ctoi(s[1])+ctoi(s[2])
      |             ^
a.cc:15:24: error: invalid types 'char[int]' for array subscript
   15 |   x = ctoi(s[0])+ctoi(s[1])+ctoi(s[2])
      |                        ^
a.cc:15:35: error: invalid types 'char[int]' for array subscript
   15 |   x = ctoi(s[0])+ctoi(s[1])+ctoi(s[2])
      |                                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int ctoi(char c) {
	if (c == '1') {
		return 1;
	}
	return 0;
}

int main() {
  char s1,s2,s3;
  cin >> s1 >> s2 >> s3;

  x = ctoi(s1)+ctoi(s2)+ctoi(s3)
  cout << x << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: 'x' was not declared in this scope
   15 |   x = ctoi(s1)+ctoi(s2)+ctoi(s3)
      |   ^
Language: C++

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

int main(){
    string s;
    cin >> s;
    int count;
    if (s[0] == "1") count = count + 1;
    if (s[1] == "1") count = count + 1;
    if (s[2] == "1") count = count + 1;

    cout << count;
}

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

#include<algorithm>//sort(all(変数),greater<型名>())　で降順に
#include<cmath>//切り上げceil(値)
#include<deque>
#include<iomanip>//setprecision(数字)
#include<iostream>
#include<list>
#include<map>
#include<numeric> //xとyの最大公約数は__gcd(x,y),xとyの最小公倍数は(x*y)/__gcd
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<vector>

#include<bits/stdc++.h>
#include<cstdio>
#include<cstdlib>
#include<tuple>
#include<utility>
#define rep(i,n) for(ll i=0; i<n; i++)
#define vll vector<ll>
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define mod 1000000007
using ll = long long;
using namespace std;

int main(){
  int ans = 0;
  int s; cin >> s;
  while(0 < s)
    if(s%10 == 1){
      ans++;
    }
    s /= 10;
  }
  cout << ans;
  return 0;
}


Compiler output:
a.cc:41:3: error: 'cout' does not name a type
   41 |   cout << ans;
      |   ^~~~
a.cc:42:3: error: expected unqualified-id before 'return'
   42 |   return 0;
      |   ^~~~~~
a.cc:43:1: error: expected declaration before '}' token
   43 | }
      | ^
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        List<String> numbers = Arrays.asList(nextLine().split(""));
        
        int count = 0;
        for (String number : numbers) {
            if (number.equals("1")) {
                count++;
            }
        }
        System.out.println(count);
	}
}

Compiler output:
Main.java:5: error: cannot find symbol
        List<String> numbers = Arrays.asList(nextLine().split(""));
                                             ^
  symbol:   method nextLine()
  location: class Main
1 error
Language: C++

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

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: 'i' was not declared in this scope
   10 |   for (i=0;i<3;++i){
      |        ^
a.cc:16:2: error: expected '}' at end of input
   16 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'str' was not declared in this scope; did you mean 'std'?
    5 |   str a;
      |   ^~~
      |   std
a.cc:6:8: error: 'a' was not declared in this scope
    6 |   cin<<a;
      |        ^
Language: C++

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:2:1: error: 'string' does not name a type
    2 | string s;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:4:1: error: 'cin' was not declared in this scope
    4 | cin >> s;
      | ^~~
a.cc:4:8: error: 's' was not declared in this scope
    4 | cin >> s;
      |        ^
a.cc:8:1: error: 'cout' was not declared in this scope
    8 | cout << ans << endl;
      | ^~~~
a.cc:8:16: error: 'endl' was not declared in this scope
    8 | cout << ans << endl;
      |                ^~~~
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		long count=Arrays.asList((new Scanner(System.in)).nextLine().split(""))
				.stream()
				.filter(s->s.equals("1"))
				.count();
		System.out.println(count);

	}


Compiler output:
Main.java:13: error: reached end of file while parsing
	}
	 ^
1 error
Language: C++

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

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


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

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

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


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: expected ';' before 'b'
    8 |   c = (a-100*b)/10
      |                   ^
      |                   ;
    9 |   b = a-100*b-10*c
      |   ~
Language: C

#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<n;i++)
#define foreach(c,itr) for(__typeof((c).begin(),(c).end())itr=c.begin();itr!=c.end();itr++) 
#define INF 1e9;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef vector<int> vi;
int main(){
	string s;
	cin>>s;
	int ans=0;
	for(int i=0;i<s.size();i++){
		if(s[i]=='1'){
			ans++;
		}
	} 
	cout<<ans;
	return 0;
}

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

import java.util.Scanner;

public class ABC081A {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		int i = Integer.parseInt(str, 2);
		System.out.println(Integer.bitCount(i));
		
	}
}


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

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

int main() {
  int a,b,c,X;
  
  cin >> X ;
  a = X / 100
  b = (X - a) / 10
  c = X - 100*a - 10*b
  
  cout << a + b + c << endl;


}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: expected ';' before 'b'
    8 |   a = X / 100
      |              ^
      |              ;
    9 |   b = (X - a) / 10
      |   ~
Language: C++

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

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


}


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

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: expected ';' before 's_2'
    7 |   cin >> s_1 s_2 s_3;
      |             ^~~~
      |             ;
Language: Java

import java.util.*;

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

Compiler output:
Main.java:8: error: cannot find symbol
		System.out.println(s.length);
		                    ^
  symbol:   variable length
  location: variable s of type String
1 error
Language: Java

import java.util.Scanner;
public class Main{
  public static void main (String[] args){
    Scanner Scan = new Scanner(System.in);
    String[] mas = Scan.next().split("");
    int cnt = 0;
    for(String x : mas){
      if(x == "1")cnt++;
    }
    System.out.prinitln(cnt);
  }
}

Compiler output:
Main.java:10: error: cannot find symbol
    System.out.prinitln(cnt);
              ^
  symbol:   method prinitln(int)
  location: variable out of type PrintStream
1 error
Language: Java

import java.util.Scanner;

public static void main (String[] args){
  Scanner Scan = new Scanner(System.in);
  int[] mas = Scan.next().split(1)(int[]);
  int cnt = 0;
  for(i : mas){
    if(mas[i] == 0)cnt++;
  }
  System.out.prinitln(cnt);
}

Compiler output:
Main.java:5: error: not a statement
  int[] mas = Scan.next().split(1)(int[]);
                                      ^
Main.java:7: error: bad initializer for for-loop
  for(i : mas){
      ^
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
public static void main (String[] args){
              ^
  (use --enable-preview to enable unnamed classes)
Main.java:5: error: ';' expected
  int[] mas = Scan.next().split(1)(int[]);
                                  ^
Main.java:5: error: ';' expected
  int[] mas = Scan.next().split(1)(int[]);
                                        ^
5 errors
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: In function 'int main()':
a.cc:11:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |   if(s[0] == "1") a++;
a.cc:12:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   if(s[1] == "1") a++;
a.cc:13:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |   if(s[2] == "1") a++;
Language: C++

#include <iostream>
#include <string>
 
using namespace std;
 
int main(){
  int i;
  int count = 0
  string s1;
  cin >> s1;
  for(i=0; i<s1.size(); i++){
    if(s1[i] == 1)
      count++;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'string'
    9 |   string s1;
      |   ^~~~~~
a.cc:10:10: error: 's1' was not declared in this scope
   10 |   cin >> s1;
      |          ^~
Language: C++

#include <iostream>
#include <string>
 
using namespace std;
 
int main(){
  int i;
  int count = 0
  std::string str;
  cin >> str;
  for(i=0; i<str.size(); i++){
    if(str[i] == 1)
      count++;
  }
  return 0;
}

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

#include <iostream>
#include <string>
 
using namespace std;
 
int main(){
  int i;
  int count = 0
  str::string str;
  cin >> str;
  for(i=0; i<str.size(); i++){
    if(str[i] == 1)
      count++;
  }
  return 0;
}

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

#include <iostream>
#include <string>
 
using namespace std;
 
int main(){
  int i;
  int count = 0
  string str;
  cin >> str;
  for(i=0; i<str.size(); i++){
    if(str[i] == 1)
      count++;
  }
  return 0;
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'string'
    9 |   string str;
      |   ^~~~~~
a.cc:10:10: error: 'str' was not declared in this scope; did you mean 'std'?
   10 |   cin >> str;
      |          ^~~
      |          std
a.cc:12:8: error: 's' was not declared in this scope
   12 |     if(s[i] == 1)
      |        ^
Language: Java

import java.util.*;
public class Main {
    public static void main(String[]args){
        
        Scanner sc = new Scanner(System.in);
        
        int [] ans = new int[3];
        
        ans[0] = sc.nextInt();
        
        ans[1] = sc.nextInt();
        
        ans[2] = sc.nextInt();

        int cnt = 0;

        for (int num : ans){
            
            if (num == 1){
                
                cnt++;
            }
        }
        
        System.out.println(cnt);
    }
       


Compiler output:
Main.java:26: error: reached end of file while parsing
    }
     ^
1 error
Language: C

#include<stdio.h>
int main()
{
  int cnt = 0;
  char s[4];
  scanf("%s",&s);
  for(int i=0;i<3;i++){
  if(s[i]==1){
  cnt++;
  }
  }
  printf("%d"\n,cnt);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:14: error: stray '\' in program
   12 |   printf("%d"\n,cnt);
      |              ^
main.c:12:14: error: expected ')' before 'n'
   12 |   printf("%d"\n,cnt);
      |         ~    ^~
      |              )
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: expected ';' before '<=' token
   10 |   for(int i = 0,i <= 3,i++){
      |                  ^~~
      |                  ;
a.cc:10:19: error: expected primary-expression before '<=' token
   10 |   for(int i = 0,i <= 3,i++){
      |                   ^~
a.cc:10:27: error: expected ';' before ')' token
   10 |   for(int i = 0,i <= 3,i++){
      |                           ^
      |                           ;
a.cc:11:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |     if(s[i] == "1"){
Language: C

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <iostream>

int main()
{
	char s1,s2,s3;

	scanf("%c",&s1);
	scanf("%c",&s2);
	scanf("%c",&s3);



	int x = 0;

	if (s1 == '1') {
		x++;
	}

	if (s2 == '1') {
		x++;
	}

	if (s3 == '1') {
		x++;
	}

	printf("%d\n",x);

}


Compiler output:
main.c:3:10: fatal error: iostream: No such file or directory
    3 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include <string>
using namespace std;
int main()
{
    string s;
    cin >> s;

    int mass_cnt = 0;
    for(i=0;i<s.length();i++) {
    	if(s[i] == '1') {
	    mass_cnt++;
	}
    }

    cout << mass_cnt << endl;
    return 0;
}

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

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

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

    int i = 0;
    for (int j = 0; j <= s.length(); ++j) {
        printf(i)
        if (s[i] == '1') {
            i++;
        }
    }
    cout << i;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   10 |         printf(i)
      |                ^
      |                |
      |                int
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:10:18: error: expected ';' before 'if'
   10 |         printf(i)
      |                  ^
      |                  ;
   11 |         if (s[i] == '1') {
      |         ~~
Language: C++

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

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

    for (int j = 0; j < len(s); ++j) {
        if (s[0] == "1") {
            i++;
        }
    }
    cout << i;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:25: error: 'len' was not declared in this scope
    9 |     for (int j = 0; j < len(s); ++j) {
      |                         ^~~
a.cc:10:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |         if (s[0] == "1") {
Language: C++

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

int main() {
    char[] s;
    cin >> s;
    int i;

    for (int j = 0; j < len(s); ++j) {
        if (s[0] == "1") {
            i++;
        }
    }
    cout << i;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: structured binding declaration cannot have type 'char'
    5 |     char[] s;
      |         ^~
a.cc:5:9: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:5:9: error: empty structured binding declaration
a.cc:5:12: error: expected initializer before 's'
    5 |     char[] s;
      |            ^
a.cc:6:12: error: 's' was not declared in this scope
    6 |     cin >> s;
      |            ^
a.cc:9:25: error: 'len' was not declared in this scope
    9 |     for (int j = 0; j < len(s); ++j) {
      |                         ^~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:30: error: expected ';' before 'cout'
    7 |         s1s2s3 = s1 + s2 + s3
      |                              ^
      |                              ;
    8 |                 cout << s1s2s3 << endl;
      |                 ~~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 's1s2s3' was not declared in this scope
    7 |         s1s2s3 = s1 + s2 + s3
      |         ^~~~~~
Language: C++

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

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


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 's1s2s3' was not declared in this scope
    7 |         s1s2s3 = s1 + s2 + s3;
      |         ^~~~~~
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:12: error: expected ';' before 's1'
    6 |         cin s1 >> s2 >> s3;
      |            ^~~
      |            ;
Language: C++

#include<iostream>
usingnamespace std;

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

Compiler output:
a.cc:2:1: error: 'usingnamespace' does not name a type
    2 | usingnamespace std;
      | ^~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |         cin>>a>>b>>c;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:17:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 |         cout<<d<<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:17:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   17 |         cout<<d<<endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: invalid types 'char[int]' for array subscript
    9 |   if(s[0] == '1'){
      |       ^
a.cc:12:7: error: invalid types 'char[int]' for array subscript
   12 |   if(s[1] == '2'){
      |       ^
a.cc:15:7: error: invalid types 'char[int]' for array subscript
   15 |   if(s[2] == '3'){
      |       ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: invalid types 'char[int]' for array subscript
    9 |   if(s[1] == '1'){
      |       ^
a.cc:12:7: error: invalid types 'char[int]' for array subscript
   12 |   if(s[2] == '2'){
      |       ^
a.cc:15:7: error: invalid types 'char[int]' for array subscript
   15 |   if(s[3] == '3'){
      |       ^
Language: C++

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

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 's1' was not declared in this scope; did you mean 's'?
    7 |   s1, s2, s3 = s/100, (s%100)/10, (s%100)%10;
      |   ^~
      |   s
a.cc:7:7: error: 's2' was not declared in this scope; did you mean 's'?
    7 |   s1, s2, s3 = s/100, (s%100)/10, (s%100)%10;
      |       ^~
      |       s
a.cc:7:11: error: 's3' was not declared in this scope; did you mean 's'?
    7 |   s1, s2, s3 = s/100, (s%100)/10, (s%100)%10;
      |           ^~
      |           s
Language: C++

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

int main () {
  int ans=0,s[3],i;
  for (j=0;j<3;j++) {
    cin >> i;
    i=s[j];
  }
  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:8: error: 'j' was not declared in this scope
    6 |   for (j=0;j<3;j++) {
      |        ^
Language: C++

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

int main () {
  int ans=0,s[3],i;
  for (j=0;j<3;j++) {
  cin >> i;
    s[i];
  }
  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:8: error: 'j' was not declared in this scope
    6 |   for (j=0;j<3;j++) {
      |        ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: expected ';' before 'b'
    6 |   cin >> a b c;
      |           ^~
      |           ;
Language: C++

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

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

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

#include <iostream>

using namespace std;

int main(void){
  int N;
  int A[210];
  int count = 0;
  cin >> N;
  for (int i = 0; i < N; ++i) cin  >> A[i];

  bool flag = true;
  int waru_kaisuu = 0;
  int waru = 2;
  while(true){
    for(int i = 0;i<N;i++){
      if(A[i]%waru != 0)break;
      waru_kaisuu++;
      waru *= 2;
  }
  cout << waru_kaisuu;
  // while(flag){
  //   int cnt = 0;
  //   for(int i = 0;N<i;++i){
  //     if(A[i]%waru == 0)count++;
  //   }
  //   if(N ==count){
  //     flag = true;
  //     waru_kaisuu++;
  //   }else{
  //     flag = false;
  //   }
  //   waru = waru *2;
  // }
  // cout <<waru_kaisuu;
  // return 0;
}

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

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

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if ((a + b + c) == 0) {
    cout << 0 << endl;
  }
  else if ((a + b + c) == 1) {
    cout << 1 << endl;
  }
  else if ((a + b + c) == 2) {
    cout << 2 << endl;
  }
  else ((a + b + c) == 3) {
    cout << 3 << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:26: error: expected ';' before '{' token
   16 |   else ((a + b + c) == 3) {
      |                          ^~
      |                          ;
Language: Java

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

Compiler output:
Main.java:8: error: cannot find symbol
      for(int i = 0;i < array.length();i++){
                             ^
  symbol:   method length()
  location: variable array of type char[]
1 error
Language: C++

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


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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,bbb,bb,b;
  double c,cc;
  bbb = a/100;
  bbb = bbb/1;
  
  bb = a/10;
  bb = bb/2;
  cc = bb/2;
  bb = (cc-bb)/0.5
  
  b = a/2;
  c = a/2;
  b = (c-b)/0.5;
  cout << bbb + bb + b<<endl;
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: expected ';' before 'b'
   13 |   bb = (cc-bb)/0.5
      |                   ^
      |                   ;
   14 | 
   15 |   b = a/2;
      |   ~
Language: C++

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

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

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

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