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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string a = Console.ReadLine();
            int num = int.Parse(a);
            int flag=0;

            if (num % 100 == 1) { flag++; }
            if (num/10 % 10 == 1) { flag++; }
            if (num/100 == 1) { flag++; }

            Console.WriteLine(a);


        }
    }
}


Compiler output:
a.cc:5:26: error: 'string' has not been declared
    5 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:5:35: error: expected ',' or '...' before 'args'
    5 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:19:6: error: expected ';' after class definition
   19 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void ConsoleApplication1::Program::Main(int*)':
a.cc:7:13: error: 'string' was not declared in this scope
    7 |             string a = Console.ReadLine();
      |             ^~~~~~
a.cc:8:23: error: expected primary-expression before 'int'
    8 |             int num = int.Parse(a);
      |                       ^~~
a.cc:15:13: error: 'Console' was not declared in this scope
   15 |             Console.WriteLine(a);
      |             ^~~~~~~
a.cc:15:31: error: 'a' was not declared in this scope
   15 |             Console.WriteLine(a);
      |                               ^
Language: Java


import java.util.Scanner;

public class Atcoder081A {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String word = sc.next();
		String[] judge = word.split("");

		int cnt = 0;

		for(int i = 0; i <= 2 ; i++) {

			if (judge[i].equals("1")) {
				cnt++;
			}else {
			}
		}
		System.out.println(cnt);
	}
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: expected '}' before 'else'
   14 |   else if ((x / 100) % 100 == 1) {
      |   ^~~~
a.cc:12:32: note: to match this '{'
   12 |   else if ((x / 10) % 10 == 1) {
      |                                ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'b' was not declared in this scope
    7 |   b = a/100;
      |   ^
a.cc:8:3: error: 'c' was not declared in this scope
    8 |   c = (a-b)/10;
      |   ^
a.cc:9:3: error: 'd' was not declared in this scope
    9 |   d = a - b - c;
      |   ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: expected ';' before 'b'
    6 |   cin >> a
      |           ^
      |           ;
    7 |   b = a/100
      |   ~
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:10:11: error: 's1' was not declared in this scope; did you mean 'y1'?
   10 |   cout << s1 + s2 + s3 << endl;
      |           ^~
      |           y1
a.cc:10:16: error: 's2' was not declared in this scope
   10 |   cout << s1 + s2 + s3 << endl;
      |                ^~
a.cc:10:21: error: 's3' was not declared in this scope
   10 |   cout << s1 + s2 + s3 << endl;
      |                     ^~
Language: C++

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

Compiler output:
a.cc:1:10: fatal error: bits/stdc++: No such file or directory
    1 | #include <bits/stdc++>
      |          ^~~~~~~~~~~~~
compilation terminated.
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:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |   if (s[0] == "1") counter ++;
a.cc:9:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |   if (s[1] == "1") counter ++;
a.cc:10:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |   if (s[2] == "1") counter ++;
Language: Java

import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    s = s.replaceALL("0","");
    System.out.println(s.lenght());
  }
}

Compiler output:
Main.java:6: error: cannot find symbol
    s = s.replaceALL("0","");
         ^
  symbol:   method replaceALL(String,String)
  location: variable s of type String
Main.java:7: error: cannot find symbol
    System.out.println(s.lenght());
                        ^
  symbol:   method lenght()
  location: variable s of type String
2 errors
Language: C++

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

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

  if(s == 111) {
    cout << 3 << endl;
  }
  else if(s == 110) {
    cout << 2 << endl;
  }
    else if(s == 101) {
    cout << 2 << endl;
  }
    else if(s == 011) {
    cout << 2 << endl;
  }
  else if(s == 001) {
    cout << 1 << endl;
  }
 else if(s == 010) {
    cout << 1 << endl;
  }
   else if(s == 100) {
    cout << 1 << endl;
}
else if(s == 000) {
    cout << 0 << endl;
  else {
     cout << 'error' << endl;
}
}


Compiler output:
a.cc:32:14: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
   32 |      cout << 'error' << endl;
      |              ^~~~~~~
a.cc: In function 'int main()':
a.cc:31:3: error: expected '}' before 'else'
   31 |   else {
      |   ^~~~
a.cc:29:19: note: to match this '{'
   29 | else if(s == 000) {
      |                   ^
Language: C++

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

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

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


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

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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:29:8: error: expected '(' before '{' token
   29 | else if{s == 000
      |        ^
      |        (
Language: C++

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

int main() {
  int s;
  cin >> s;
}
  if(s == 111) {
    cout << 3 << endl;
  }
  if(s == 110) {
    cout << 2 << endl;
  }
    if(s == 101) {
    cout << 2 << endl;
  }
    if(s == 011) {
    cout << 2 << endl;
  }
  if(s == 001) {
    cout << 1 << endl;
  }
if(s == 010) {
    cout << 1 << endl;
  }
  if(s == 100) {
    cout << 1 << endl;
}
else {
    cout << 0 << endl;
}



Compiler output:
a.cc:8:3: error: expected unqualified-id before 'if'
    8 |   if(s == 111) {
      |   ^~
a.cc:11:3: error: expected unqualified-id before 'if'
   11 |   if(s == 110) {
      |   ^~
a.cc:14:5: error: expected unqualified-id before 'if'
   14 |     if(s == 101) {
      |     ^~
a.cc:17:5: error: expected unqualified-id before 'if'
   17 |     if(s == 011) {
      |     ^~
a.cc:20:3: error: expected unqualified-id before 'if'
   20 |   if(s == 001) {
      |   ^~
a.cc:23:1: error: expected unqualified-id before 'if'
   23 | if(s == 010) {
      | ^~
a.cc:26:3: error: expected unqualified-id before 'if'
   26 |   if(s == 100) {
      |   ^~
a.cc:29:1: error: expected unqualified-id before 'else'
   29 | else {
      | ^~~~
Language: C++

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

int main() {
  int s;
  cin >> s;
  if(s == 111) {
    cout << 3 << endl;
  }
  if(s == 110) {
    cout << 2 << endl;
  }
    if(s == 101) {
    cout << 2 << endl;
  }
    if(s == 011) {
    cout << 2 << endl;
  }
  if(s == 001) {
    cout << 1 << endl;
  }
if(s == 010) {
    cout << 1 << endl;
  }
  if(s == 100) {
    cout << 1 << endl;
}
if(s == 000) {
    cout << 0 << endl;
  }

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

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

int main() {
  int s;
  cin >> s;
  int.at(0) = s1;
  int.at(1) = s2;
  int.at(2) = s3;
    
  cout << s1 + s2 + s3 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: expected unqualified-id before '.' token
    7 |   int.at(0) = s1;
      |      ^
a.cc:8:6: error: expected unqualified-id before '.' token
    8 |   int.at(1) = s2;
      |      ^
a.cc:9:6: error: expected unqualified-id before '.' token
    9 |   int.at(2) = s3;
      |      ^
a.cc:11:11: error: 's1' was not declared in this scope; did you mean 's'?
   11 |   cout << s1 + s2 + s3 << endl;
      |           ^~
      |           s
a.cc:11:16: error: 's2' was not declared in this scope; did you mean 's'?
   11 |   cout << s1 + s2 + s3 << endl;
      |                ^~
      |                s
a.cc:11:21: error: 's3' was not declared in this scope; did you mean 's'?
   11 |   cout << s1 + s2 + s3 << endl;
      |                     ^~
      |                     s
Language: C++

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

int main() {

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: expected unqualified-id before '.' token
   11 |     if (int.at(i) == '1') {
      |            ^
a.cc:15:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main() {

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: request for member 'at' in 's', which is of non-class type 'int'
   11 |     if (s.at(i) == '1') {
      |           ^~
a.cc:15:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main() {

  int s;
cin >> s;
  
  int count = 0;
  for (int i = 0; i < 4; i++) {
    if (str.at(i) == '1') {
      count++;
    }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'str' was not declared in this scope; did you mean 'std'?
   11 |     if (str.at(i) == '1') {
      |         ^~~
      |         std
a.cc:15:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'b' was not declared in this scope
    8 |   b = s/10-10*a;
      |   ^
a.cc:9:3: error: 'c' was not declared in this scope
    9 |   c = s%100;
      |   ^
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:9:23: error: expected ';' before 'if'
    9 |    if(s[0] == 1) ans++
      |                       ^
      |                       ;
   10 |         if(s[1] == 1) ans++
      |         ~~
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:1:10: fatal error: bits++stdc.h: No such file or directory
    1 | #include <bits++stdc.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
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:10:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |    if(s[0] == "1") ans++
a.cc:10:25: error: expected ';' before 'if'
   10 |    if(s[0] == "1") ans++
      |                         ^
      |                         ;
   11 |         if(s[1] == "1") ans++
      |         ~~
Language: C++

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

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

 	cout << counter << endl;

}


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

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

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

 	cout << counter << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   11 |     if ( s[0] = "1") counter ++;
      |                 ^~~
      |                 |
      |                 const char*
a.cc:12:21: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   12 |         if ( s[1] = "1") counter ++;
      |                     ^~~
      |                     |
      |                     const char*
a.cc:13:17: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   13 |     if ( s[2] = "1") counter ++;
      |                 ^~~
      |                 |
      |                 const char*
Language: C++

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

int main() {
	string x;
	cin >> x;
    
    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:11:10: error: 's' was not declared in this scope
   11 |     if ( s[0] = "1") counter ++;
      |          ^
a.cc:12:14: error: 's' was not declared in this scope
   12 |         if ( s[1] = "1") counter ++;
      |              ^
a.cc:13:10: error: 's' was not declared in this scope
   13 |     if ( s[2] = "1") counter ++;
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int counter;
  string s;
  cin >> s;
  int counter;
  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:7: error: redeclaration of 'int counter'
    8 |   int counter;
      |       ^~~~~~~
a.cc:5:7: note: 'int counter' previously declared here
    5 |   int counter;
      |       ^~~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected primary-expression before '=' token
    8 |   if(s1 === 1)counter++;
      |           ^
a.cc:9:11: error: expected primary-expression before '=' token
    9 |   if(s2 === 1)counter++;
      |           ^
a.cc:10:11: error: expected primary-expression before '=' token
   10 |   if(s3 === 1)counter++;
      |           ^
Language: C++

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

int ctoi(char c) {
  if (c =='0') {
    return 0; 
	} else if (c =='1') {
    return 1;} else {return 0;}
  }
    

int main() {
  string s;
  cin >> s;
  int s1, s2, s3;
  s1 = ctoi(s.at(0));
  s2 = ctoi(s.at(1));
  s3 = ctoi(s.at(2));
  cout << s1+s2+s3 <, endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:21: error: expected primary-expression before ',' token
   19 |   cout << s1+s2+s3 <, endl;
      |                     ^
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: Java

import java.util.*;
 
public class Main81B{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int count = sc.nextInt();
    int count2 = 0;
    int min =0;
    for(int i=0; i < count; i++ ){
        int a = sc.nextInt();
        while(a%2 == 0){
            a = a/2;
            count2++;
        }
        if(min == 0){
            min = count2;
        }
        if(min >= count2){
            min = count2;
        }
        count2 = 0;
    }
        System.out.println(min);
        sc.close();
    }    
}


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: expected unqualified-id before '[' token
   10 |     if(string[i] == '1'){
      |              ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: expected unqualified-id before '[' token
   10 |     if(string[i] == 1){
      |              ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: expected unqualified-id before '[' token
   10 |     if(string[i] == 1){
      |              ^
Language: Java

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


Compiler output:
Main.java:7: error: illegal character: '\u3000'
    for(int i=1; i <?4; i++ ){
                    ^
Main.java:7: error: ';' expected
    for(int i=1; i <?4; i++ ){
                           ^
2 errors
Language: C++

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

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


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

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


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

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

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

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

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
    5 |   string s;
      |   ^~~~~~
a.cc:5:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/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:15: error: 's' was not declared in this scope
    7 |   std::cin >> s;
      |               ^
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/10)*10) << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:58: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    8 |   cout << (a/100) + ((a/10)-(a/100)*10) + ((a-(a/10)*10) << endl;
      |                                            ~~~~~~~~~~~~~~^~~~~~~
a.cc:8:65: error: expected ')' before ';' token
    8 |   cout << (a/100) + ((a/10)-(a/100)*10) + ((a-(a/10)*10) << endl;
      |                                           ~                     ^
      |                                                                 )
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:50: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    8 |   cout << (a/100) + ((a/10)/10) + ((a-(a/10)*10) << endl;
      |                                    ~~~~~~~~~~~~~~^~~~~~~
a.cc:8:57: error: expected ')' before ';' token
    8 |   cout << (a/100) + ((a/10)/10) + ((a-(a/10)*10) << endl;
      |                                   ~                     ^
      |                                                         )
Language: Java

import java.util.*;

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

Compiler output:
Main.java:7: error: no suitable method found for replace(int,String)
    s = s.replace(0,"");
         ^
    method String.replace(char,char) is not applicable
      (argument mismatch; possible lossy conversion from int to char)
    method String.replace(CharSequence,CharSequence) is not applicable
      (argument mismatch; int cannot be converted to CharSequence)
1 error
Language: C++

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

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

package main


import (
    "fmt"
)

func main() {

    var s int32

    fmt.Scanf("%d\n",&s)
    fmt.Println( s/100+s%100/10+s%100%10)
}


Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
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 cnt = 0;

    while (true){
	bool odd_flag = false;{
	for (int i = 0; i < N; ++i)
	  if (A[i] % 2 != 0)
	    odd_flag = true;
        }

        if (odd_flag) break

        for (int i = 0; i < N; ++i){
	  A[i] /= 2; 
        }
	++cnt;
    }

    cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: expected ';' before 'int'
   10 |         cin >> A[i]
      |                    ^
      |                    ;
   11 | 
   12 |     int cnt = 0;
      |     ~~~             
a.cc:21:28: error: expected ';' before 'for'
   21 |         if (odd_flag) break
      |                            ^
      |                            ;
   22 | 
   23 |         for (int i = 0; i < N; ++i){
      |         ~~~                 
a.cc:26:11: error: 'cnt' was not declared in this scope; did you mean 'int'?
   26 |         ++cnt;
      |           ^~~
      |           int
a.cc:29:13: error: 'cnt' was not declared in this scope; did you mean 'int'?
   29 |     cout << cnt << endl;
      |             ^~~
      |             int
Language: C++

#include <iostream>
usingnamespace std;
int main(){
  string s;
  cin>>s;
  int ans=0;
  for (int i=0:i<3:i++){ans+=s[i]};
  cout<<ans;}

Compiler output:
a.cc:2:1: error: 'usingnamespace' does not name a type
    2 | usingnamespace std;
      | ^~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   string s;
      |   ^~~~~~
a.cc:4: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:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>s;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:5:8: error: 's' was not declared in this scope
    5 |   cin>>s;
      |        ^
a.cc:7:13: error: initializer in range-based 'for' loop
    7 |   for (int i=0:i<3:i++){ans+=s[i]};
      |             ^
a.cc:7:19: error: expected ')' before ':' token
    7 |   for (int i=0:i<3:i++){ans+=s[i]};
      |       ~           ^
      |                   )
a.cc:7:19: error: expected primary-expression before ':' token
a.cc:8:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |   cout<<ans;}
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>
usingnamespace std;
int main(){
  string s;
  cin>>s;
  int ans=0;
  for (int i=0:i<3:i++){ans+=s[i]}
  cout<<ans;}

Compiler output:
a.cc:2:1: error: 'usingnamespace' does not name a type
    2 | usingnamespace std;
      | ^~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   string s;
      |   ^~~~~~
a.cc:4: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:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>s;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:5:8: error: 's' was not declared in this scope
    5 |   cin>>s;
      |        ^
a.cc:7:13: error: initializer in range-based 'for' loop
    7 |   for (int i=0:i<3:i++){ans+=s[i]}
      |             ^
a.cc:7:19: error: expected ')' before ':' token
    7 |   for (int i=0:i<3:i++){ans+=s[i]}
      |       ~           ^
      |                   )
a.cc:7:19: error: expected primary-expression before ':' token
a.cc:8:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |   cout<<ans;}
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

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

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

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

#include<stdio.h>

int main(){
  
  int i,count=0;
  char s[];
  
  scanf("%s",&s);
  
  for(i=0;i<3;i++){
  if(s=="1"){
    count++;
    }
  }
  
return 0;  
}

Compiler output:
main.c: In function 'main':
main.c:6:8: error: array size missing in 's'
    6 |   char s[];
      |        ^
Language: C

#include<stdio.h>

int main(){
  
  int s,i,count=0;
  
  scanf("%s",&s);
  
  for(i=0;i<3;i++){
  if(s=="1"){
    count++
    }
  }
  
return 0;  
}

Compiler output:
main.c: In function 'main':
main.c:10:7: warning: comparison between pointer and integer
   10 |   if(s=="1"){
      |       ^~
main.c:11:12: error: expected ';' before '}' token
   11 |     count++
      |            ^
      |            ;
   12 |     }
      |     ~
Language: C

#include<stdio.h>

int main(){
  
  int i,a,put;
  char s[];
  
  scanf("%d",&a);
  
  sprintf(s,"%d",a);
  
  for(i=0;i<3;i++){
    if(s[i]==1){
      put++;
    }
  }
  printf("%d",put);
return 0;  
}

Compiler output:
main.c: In function 'main':
main.c:6:8: error: array size missing in 's'
    6 |   char s[];
      |        ^
Language: C

#include<stdio.h>

int main(){
  
  int i,put;
  char s[];
  
  scanf("%d",&s);
  
  for(i=0;i<3;i++){
    if(s[i]==1){
      put++;
    }
  }
  printf("%d",put);
return 0;  
}

Compiler output:
main.c: In function 'main':
main.c:6:8: error: array size missing in 's'
    6 |   char s[];
      |        ^
Language: C

#include<stdio.h>

int main(){
  
  int i,put;
  char s[];
  
  scanf("%d",&s);
  
  for(i=0;i<3;i++){
    if(s[i]==1){
      put++;
    }
  }
  printf("%d",put);
  



}

Compiler output:
main.c: In function 'main':
main.c:6:8: error: array size missing in 's'
    6 |   char s[];
      |        ^
Language: C

#include<stdio.h>

int main(){
  
  int i,put;
  char s[];
  
  scanf("%d",&s);
  
  for(i=0:i<3:i++){
    if(s[i]==1){
      put++;
    }
  }
  printf("%d",put);
  



}

Compiler output:
main.c: In function 'main':
main.c:6:8: error: array size missing in 's'
    6 |   char s[];
      |        ^
main.c:10:10: error: expected ';' before ':' token
   10 |   for(i=0:i<3:i++){
      |          ^
      |          ;
main.c:10:18: error: expected expression before ')' token
   10 |   for(i=0:i<3:i++){
      |                  ^
Language: C

include<stdio.h>

int main(){
  
  int i,put;
  char s[4];
  
  scanf("%d",&s);
  
  for(i=0:i<3:i++){
    if(s[i]==1){
      put++;
    }
  }
  printf("%d",put);
  



}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

include<stdio.h>

int main(){
  
  int i,put;
  char s[];
  
  scanf("%d",&s);
  
  for(i=0:i<3:i++){
    if(s[i]==1){
      put++;
    }
  }
  printf("%d",put);
  



}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

include<stdio.h>

int main(){
  
  int i,put;
  char s[]
  
  scanf("%d",&s);
  
  for(i=0:i<3:i++){
    if(s[i]==1){
      put++;
    }
  }
  printf("%d",put);
  



}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C++

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

int main() {

string a,cnt=0; cin>>a;
  if(a.at(0)=='1'){cnt++;}
  if(a.at(1)=='1'){cnt++;}
  if(a.at(2)=='1'){cnt++;}
cout<<cnt<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
    7 |   if(a.at(0)=='1'){cnt++;}
      |                    ~~~^~
a.cc:8:23: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
    8 |   if(a.at(1)=='1'){cnt++;}
      |                    ~~~^~
a.cc:9:23: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
    9 |   if(a.at(2)=='1'){cnt++;}
      |                    ~~~^~
Language: C++

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

int main() {

string a,cnt=0; cin>>a;
  if(a.at(0)==1){cnt++;}
  if(a.at(1)==1){cnt++;}
  if(a.at(2)==1){cnt++;}
cout<<cnt<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
    7 |   if(a.at(0)==1){cnt++;}
      |                  ~~~^~
a.cc:8:21: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
    8 |   if(a.at(1)==1){cnt++;}
      |                  ~~~^~
a.cc:9:21: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
    9 |   if(a.at(2)==1){cnt++;}
      |                  ~~~^~
Language: C++

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

int main() {

string acnt=0; cin>>a;
  if(a.at(0)==1){cnt++;}
  if(a.at(1)==1){cnt++;}
  if(a.at(2)==1){cnt++;}
cout<<cnt<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:21: error: 'a' was not declared in this scope
    6 | string acnt=0; cin>>a;
      |                     ^
a.cc:7:18: error: 'cnt' was not declared in this scope; did you mean 'acnt'?
    7 |   if(a.at(0)==1){cnt++;}
      |                  ^~~
      |                  acnt
a.cc:8:18: error: 'cnt' was not declared in this scope; did you mean 'acnt'?
    8 |   if(a.at(1)==1){cnt++;}
      |                  ^~~
      |                  acnt
a.cc:9:18: error: 'cnt' was not declared in this scope; did you mean 'acnt'?
    9 |   if(a.at(2)==1){cnt++;}
      |                  ^~~
      |                  acnt
a.cc:10:7: error: 'cnt' was not declared in this scope; did you mean 'acnt'?
   10 | cout<<cnt<<endl;}
      |       ^~~
      |       acnt
Language: C++

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


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: invalid types 'int[int]' for array subscript
    7 |   cout << a[0]+a[1]+a[2] << endl;
      |            ^
a.cc:7:17: error: invalid types 'int[int]' for array subscript
    7 |   cout << a[0]+a[1]+a[2] << endl;
      |                 ^
a.cc:7:22: error: invalid types 'int[int]' for array subscript
    7 |   cout << a[0]+a[1]+a[2] << endl;
      |                      ^
Language: C++

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

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


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

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:7: error: structured binding declaration cannot have type 'char'
    5 |   char[] masu;
      |       ^~
a.cc:5:7: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:5:7: error: empty structured binding declaration
a.cc:5:10: error: expected initializer before 'masu'
    5 |   char[] masu;
      |          ^~~~
a.cc:7:10: error: 'masu' was not declared in this scope
    7 |   cin >> masu ;
      |          ^~~~
Language: C++

#include <iostream>

using namespace std;

int main() {
    string s;
    cin >> s;
    cout << count(s.begin(), s.end(), '1') << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'count' was not declared in this scope
    8 |     cout << count(s.begin(), s.end(), '1') << endl;
      |             ^~~~~
Language: C++

#include <iostream>

int main() {
  std::string s;
  std::cin >> s;
  
  std::cout << std::count(s.cbegin(), s.cend(), '1') << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: 'count' is not a member of 'std'; did you mean 'cout'?
    7 |   std::cout << std::count(s.cbegin(), s.cend(), '1') << std::endl;
      |                     ^~~~~
      |                     cout
Language: C

#include <stdio.h>

int main(void){
  int a;
  scanf("%d",&a);
  
  char s[4] = {'\0'};
  
  sprintf(s, "%d", a);
  
  int i;
  int c = 0;
  
  for (i = 0; i < 3; i++){
    if(s[i]='1')
      c++;
  }
  
  printf("%d",c};
  
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:19:16: error: expected ')' before '}' token
   19 |   printf("%d",c};
      |         ~      ^
      |                )
main.c:19:16: error: expected ';' before '}' token
   19 |   printf("%d",c};
      |                ^
      |                ;
main.c: At top level:
main.c:21:3: error: expected identifier or '(' before 'return'
   21 |   return 0;
      |   ^~~~~~
main.c:22:1: error: expected identifier or '(' before '}' token
   22 | }
      | ^
Language: C

#include <stdio.h>

int main(void){
  int a;
  scanf("%d",&a);
  
  char s[3] = {'\0'};
  
  sprintf(s, "%d", a);
  
  int i;
  int c = 0;
  
  for (i = 0; i < 3; i++){
    if(s[i]=='1')
      c++;
  }
  
  printf{"%d",c};
  
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:19:9: error: expected ';' before '{' token
   19 |   printf{"%d",c};
      |         ^
      |         ;
Language: C

#include <stdio.h>

int main(void){
  int a;
  scanf("%d",&a);
  
  char s[3] = {'\0'};
  
  sprintf(s, "%d", a);
  
  int i;
  int c = 0;
  
  for (i = 0; i < 3; i++){
    if(s[i]='1')
      c++;
  }
  
  printf{"%d",c};
  
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:19:9: error: expected ';' before '{' token
   19 |   printf{"%d",c};
      |         ^
      |         ;
Language: C

#include <stdio.h>

int main(void){
  int a;
  scanf("%d",&a);
  
  char s[3] = {'\0'};
  
  sprintf(s, "%d", a);
  
  int i;
  int c = 0;
  
  for (i = 0; i < 3; i++){
    if(s[i]='1')
      c++;
  }
  
  printf("%d",c};
  
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:19:16: error: expected ')' before '}' token
   19 |   printf("%d",c};
      |         ~      ^
      |                )
main.c:19:16: error: expected ';' before '}' token
   19 |   printf("%d",c};
      |                ^
      |                ;
main.c: At top level:
main.c:21:3: error: expected identifier or '(' before 'return'
   21 |   return 0;
      |   ^~~~~~
main.c:22:1: error: expected identifier or '(' before '}' token
   22 | }
      | ^
Language: C

#include <stdio.h>

int main(void){
  int a;
  scanf("%d",&a);
  
  char s[3] = {'\0'};
  
  sprintf(s, "%d", a);
  
  int i;
  int c = 0;
  
  for (i = 0; i < 3; i++){
    if(s[i]='1')
      c++;
  }
  
  printf("%d", &c};
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:18: error: expected ')' before '}' token
   19 |   printf("%d", &c};
      |         ~        ^
      |                  )
main.c:19:18: error: expected ';' before '}' token
   19 |   printf("%d", &c};
      |                  ^
      |                  ;
main.c: At top level:
main.c:21:3: error: expected identifier or '(' before 'return'
   21 |   return 0;
      |   ^~~~~~
main.c:22:1: error: expected identifier or '(' before '}' token
   22 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); i++)
int main()
{
    int n;
    cin >> n;
  
  	int ans = 0;
  	for(int i=0; i<3; i++){
		if(n & 1) ans++;
		n =<< 1;
    }
    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: expected primary-expression before '<<' token
   12 |                 n =<< 1;
      |                    ^~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

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


Compiler output:
a.cc:10:17: error: macro "rep" requires 2 arguments, but only 1 given
   10 |     rep(s.size()){
      |                 ^
a.cc:2:9: note: macro "rep" defined here
    2 | #define rep(i,n) for (int i = 0; i < (n); ++i)
      |         ^~~
a.cc: In function 'int main()':
a.cc:10:5: error: 'rep' was not declared in this scope
   10 |     rep(s.size()){
      |     ^~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'a' was not declared in this scope
    8 |   s = 100 * a + 10 * b + c;
      |             ^
a.cc:8:22: error: 'b' was not declared in this scope
    8 |   s = 100 * a + 10 * b + c;
      |                      ^
a.cc:8:26: error: 'c' was not declared in this scope
    8 |   s = 100 * a + 10 * b + c;
      |                          ^
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:6:13: error: conflicting declaration 'int s [2]'
    6 |   int s[1], s[2], s[3];
      |             ^
a.cc:6:7: note: previous declaration as 'int s [1]'
    6 |   int s[1], s[2], s[3];
      |       ^
a.cc:6:19: error: conflicting declaration 'int s [3]'
    6 |   int s[1], s[2], s[3];
      |                   ^
a.cc:6:7: note: previous declaration as 'int s [1]'
    6 |   int s[1], s[2], s[3];
      |       ^
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:6:13: error: conflicting declaration 'int s [2]'
    6 |   int s[1], s[2], s[3];
      |             ^
a.cc:6:7: note: previous declaration as 'int s [1]'
    6 |   int s[1], s[2], s[3];
      |       ^
a.cc:6:19: error: conflicting declaration 'int s [3]'
    6 |   int s[1], s[2], s[3];
      |                   ^
a.cc:6:7: note: previous declaration as 'int s [1]'
    6 |   int s[1], s[2], s[3];
      |       ^