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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _02_ABC081A
{
    class Program
    {
        static void Main(string[] args)
        {

            string s= Console.ReadLine(); ;

            int counter = 0;

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

            Console.WriteLine(counter);

            Console.Read();
                

        }
    }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Linq;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Text;
      |       ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
    5 | using System.Threading.Tasks;
      |       ^~~~~~
a.cc:11:26: error: 'string' has not been declared
   11 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:11:35: error: expected ',' or '...' before 'args'
   11 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:28:6: error: expected ';' after class definition
   28 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void _02_ABC081A::Program::Main(int*)':
a.cc:14:13: error: 'string' was not declared in this scope
   14 |             string s= Console.ReadLine(); ;
      |             ^~~~~~
a.cc:18:17: error: 's' was not declared in this scope
   18 |             if (s[0] == '1') { counter++; }
      |                 ^
a.cc:19:17: error: 's' was not declared in this scope
   19 |             if (s[1] == '1') { counter++; }
      |                 ^
a.cc:20:17: error: 's' was not declared in this scope
   20 |             if (s[2] == '1') { counter++; }
      |                 ^
a.cc:22:13: error: 'Console' was not declared in this scope
   22 |             Console.WriteLine(counter);
      |             ^~~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:2:3: error: 'string' was not declared in this scope
    2 |   string str;
      |   ^~~~~~
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin >> str;
      |   ^~~
a.cc:4:10: error: 'str' was not declared in this scope; did you mean 'std'?
    4 |   cin >> str;
      |          ^~~
      |          std
a.cc:13:3: error: 'cout' was not declared in this scope; did you mean 'count'?
   13 |   cout << count << endl;
      |   ^~~~
      |   count
a.cc:13:20: error: 'endl' was not declared in this scope
   13 |   cout << count << endl;
      |                    ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:2:3: error: 'string' was not declared in this scope
    2 |   string str;
      |   ^~~~~~
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin >> str;
      |   ^~~
a.cc:4:10: error: 'str' was not declared in this scope; did you mean 'std'?
    4 |   cin >> str;
      |          ^~~
      |          std
a.cc:12:3: error: 'cout' was not declared in this scope; did you mean 'count'?
   12 |   cout << count << endl;
      |   ^~~~
      |   count
a.cc:12:20: error: 'endl' was not declared in this scope
   12 |   cout << count << endl;
      |                    ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:2:3: error: 'string' was not declared in this scope
    2 |   string str;
      |   ^~~~~~
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin >> str;
      |   ^~~
a.cc:4:10: error: 'str' was not declared in this scope; did you mean 'std'?
    4 |   cin >> str;
      |          ^~~
      |          std
a.cc:13:3: error: 'cout' was not declared in this scope; did you mean 'count'?
   13 |   cout << count << endl;
      |   ^~~~
      |   count
a.cc:13:20: error: 'endl' was not declared in this scope
   13 |   cout << count << endl;
      |                    ^~~~
Language: Java

package problem02;

import java.util.*;

public class problem02 {
	// output:number of bi boll
	// input:3 math
	public static void main(String args[]) {
		
		// input:math info set to array from 
		int boll_num = 0;
		//int math[] = new int[3];
		
		Scanner scan = new Scanner(System.in);
		
		String stdin = scan.next();
		
		// evaluate the value ot each math
		for(int i=0;i<stdin.length();i++) {
			//System.out.println(String.valueOf(stdin.charAt(i)));
			if("1".equals(String.valueOf(stdin.charAt(i)))) boll_num++;
		}
		scan.close();
		
		// output:number of bi boll
		System.out.println(boll_num);
	}
}


Compiler output:
Main.java:5: error: class problem02 is public, should be declared in a file named problem02.java
public class problem02 {
       ^
1 error
Language: Java

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

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

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

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

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

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

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

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

#include<iostream>
using namespace std;

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

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

#include<iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
    8 |   if(masu[0] = "1")i+=1;
      |                ^~~
      |                |
      |                const char*
a.cc:9:16: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
    9 |   if(masu[1] = "1")i+=1;
      |                ^~~
      |                |
      |                const char*
a.cc:10:16: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   10 |   if(masu[2] = "1")i+=1;
      |                ^~~
      |                |
      |                const char*
Language: Java

import java.util.Scanner;
public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int count = 0;
        int n = sc.nextInt();  
        int a[] = new int[n];  
        for(int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
		}
        for(int j = 0;; j++) {
        for(int  i= 0; i < n; i++) {
        	if(a[i]%2==1)break out; 
        a[i]=a[i]/2;
        }
        	count++;
        }
        System.out.println(count);
    }
}

Compiler output:
Main.java:13: error: undefined label: out
        	if(a[i]%2==1)break out; 
        	             ^
1 error
Language: C++

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


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

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


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

#include<iostream>
using namespace std;

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

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

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

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


Compiler output:
a.cc:9:10: error: extended character 　 is not valid in an identifier
    9 |   cout <<　s  << endl;
      |          ^
a.cc: In function 'int main()':
a.cc:6:7: error: conflicting declaration 'int s'
    6 |   int s;
      |       ^
a.cc:5:10: note: previous declaration as 'std::string s'
    5 |   string s;
      |          ^
a.cc:8:12: error: 'a' was not declared in this scope
    8 |   if(s[1]==a);
      |            ^
a.cc:9:10: error: '\U00003000s' was not declared in this scope
    9 |   cout <<　s  << endl;
      |          ^~~
Language: C

#include <stdio.h>

int main (void)
{
  char a,b,c;
  int d = 0
  
  scanf("%s%s%s",&a,&b,&c)
  if(a==1) d++;
  if(b==1) d++;
  if(c==1) d++;
  printf("%s",d);
  return 0;
}
  

Compiler output:
main.c: In function 'main':
main.c:8:3: error: expected ',' or ';' before 'scanf'
    8 |   scanf("%s%s%s",&a,&b,&c)
      |   ^~~~~
Language: C++

#include<iostream>
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

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		String numStr = sc.next();
		
		int num = 0;
		num = '1' == numStr.charAt(0) ? num += 1 : num;
		num = '1' == numStr.charAt(1) ? num += 1 : num;
		num = '1' == numStr.charAt(2) ? num += 1 : num;
		
		System.out.println(num);
	}

Compiler output:
Main.java:1: 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)
1 error
Language: Java

import java.util.*;

public class Abc081_a {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		String numStr = sc.next();
		
		int num = 0;
		num = '1' == numStr.charAt(0) ? num += 1 : num;
		num = '1' == numStr.charAt(1) ? num += 1 : num;
		num = '1' == numStr.charAt(2) ? num += 1 : num;
		
		System.out.println(num);
	}
}


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

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

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

  int counter
  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:3: error: expected initializer before 'counter'
   11 |   counter = 0;
      |   ^~~~~~~
a.cc:13:24: error: 'counter' was not declared in this scope
   13 |   if ( s[0] == '1' ) ++counter;
      |                        ^~~~~~~
a.cc:14:24: error: 'counter' was not declared in this scope
   14 |   if ( s[1] == '1' ) ++counter;
      |                        ^~~~~~~
a.cc:15:24: error: 'counter' was not declared in this scope
   15 |   if ( s[2] == '1' ) ++counter;
      |                        ^~~~~~~
a.cc:17:11: error: 'counter' was not declared in this scope
   17 |   cout << counter << endl;
      |           ^~~~~~~
Language: C++

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

int main()
{
  string s;
  cin >> s;
  
  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:10:3: error: 'counter' was not declared in this scope
   10 |   counter = 0;
      |   ^~~~~~~
Language: C++

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

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

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


Compiler output:
Main.java:8: error: bad operand types for binary operator '=='
    if(s.charAt(i) == "1"){count = count +1;}
                   ^
  first type:  char
  second type: String
1 error
Language: Java

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

Compiler output:
Main.java:5: error: incompatible types: String cannot be converted to String[]
  String[] s = sc.next();
                      ^
Main.java:8: error: cannot find symbol
    if(s.charAt(i) == 1){count = count +1;}
        ^
  symbol:   method charAt(int)
  location: variable s of type String[]
2 errors
Language: C++

package main

import (
	"fmt"
)

func main() {
	var s string
	var i int
	fmt.Scanln(&s)
	if s[0] == '1' {
		i++
	}
	if s[1] == '1' {
		i++
	}
	if s[2] == '1' {
		i++
	}
	fmt.Println(i)
	return
}


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

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

Compiler output:
a.cc:4:1: error: '::main' must return 'int'
    4 | void main()
      | ^~~~
Language: C++

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

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

Compiler output:
a.cc:8:1: error: extended character 　 is not valid in an identifier
    8 | 　for(int i=0;i<s.size();i++){
      | ^
a.cc:9:1: error: extended character 　 is not valid in an identifier
    9 | 　  if(s[i]=='1') ans++;
      | ^
a.cc:10:1: error: extended character 　 is not valid in an identifier
   10 | 　}
      | ^
a.cc: In function 'int main()':
a.cc:8:7: error: expected primary-expression before 'int'
    8 | 　for(int i=0;i<s.size();i++){
      |       ^~~
a.cc:8:15: error: 'i' was not declared in this scope
    8 | 　for(int i=0;i<s.size();i++){
      |               ^
Language: C++

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

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


Compiler output:
a.cc:8:1: error: extended character 　 is not valid in an identifier
    8 | 　for(int i=0;i<s.size();i++){
      | ^
a.cc:9:1: error: extended character 　 is not valid in an identifier
    9 | 　  if(s[i]=='1') ans++;
      | ^
a.cc:10:1: error: extended character 　 is not valid in an identifier
   10 | 　}
      | ^
a.cc: In function 'int main()':
a.cc:8:7: error: expected primary-expression before 'int'
    8 | 　for(int i=0;i<s.size();i++){
      |       ^~~
a.cc:8:15: error: 'i' was not declared in this scope
    8 | 　for(int i=0;i<s.size();i++){
      |               ^
Language: C++

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

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


Compiler output:
a.cc:8:1: error: extended character 　 is not valid in an identifier
    8 | 　for(int i=0;s.size();i++){
      | ^
a.cc:9:1: error: extended character 　 is not valid in an identifier
    9 | 　  if(s[i]=='1') ans++;
      | ^
a.cc:10:1: error: extended character 　 is not valid in an identifier
   10 | 　}
      | ^
a.cc: In function 'int main()':
a.cc:8:7: error: expected primary-expression before 'int'
    8 | 　for(int i=0;s.size();i++){
      |       ^~~
a.cc:8:21: warning: ignoring return value of '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]', declared with attribute 'nodiscard' [-Wunused-result]
    8 | 　for(int i=0;s.size();i++){
      |               ~~~~~~^~
In file included 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/c++/14/bits/basic_string.h:1076:7: note: declared here
 1076 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
a.cc:8:24: error: 'i' was not declared in this scope
    8 | 　for(int i=0;s.size();i++){
      |                        ^
Language: C++

#include<iostream>
 
int main() {
	int a;
	std::cin >>a;
	
	if (a == 000) {
		std::cout << 0 << std::endl;
	}
	else {
 
		if (a == 111) {
			std::cout << 3 << std::endl;
		}
		else {
			if (a == 100 | a == 010 | a == 001) {
				std::cout << 1 << std::endl;
			}
			else {
				std::cout << 2 << std::endl;
			}
		}
	}
}

Compiler output:
a.cc:2:1: error: extended character   is not valid in an identifier
    2 |  
      | ^
a.cc:11:1: error: extended character   is not valid in an identifier
   11 |  
      | ^
a.cc:2:1: error: '\U000000a0' does not name a type
    2 |  
      | ^
Language: C++

#include<iostream>
using namespace std; 
 
 
int main()
{
int a;
cin >> a ;
if(a == 000){printf("0");}
if(010>= a >= 001){printf("1");}
if(a == 011){printf("2");}
if(a == 100){pringf("1");}
if(110>= a >=101){pringf("2");}
if(a == "111"){printf("3");}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: 'pringf' was not declared in this scope; did you mean 'printf'?
   12 | if(a == 100){pringf("1");}
      |              ^~~~~~
      |              printf
a.cc:13:19: error: 'pringf' was not declared in this scope; did you mean 'printf'?
   13 | if(110>= a >=101){pringf("2");}
      |                   ^~~~~~
      |                   printf
a.cc:14:6: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 | if(a == "111"){printf("3");}
      |    ~~^~~~~~~~
Language: C++

#include<iostream>
using namespace std; 
 
 
int main()
{
string a;
cin >> a ;
if(a == "000"){printf("0");}
if(a == "001")or(a == "010")or(a == "100"){printf("1");}
if(a == "011")or(a == "101")or(a == "110"){printf("2");}
if(a == "111"){printf("3");}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: expected primary-expression before 'or' token
   10 | if(a == "001")or(a == "010")or(a == "100"){printf("1");}
      |               ^~
a.cc:11:15: error: expected primary-expression before 'or' token
   11 | if(a == "011")or(a == "101")or(a == "110"){printf("2");}
      |               ^~
Language: C++

#include<iostream>
using namespace std; 
 
 
int main()
{
string a;
cin >> a ;
if(a == "000"){printf("0");}
if(a == "001"),(a == "010"),(a == "100"){printf("1");}
if(a == "011"),(a == "101"),(a == "110"){printf("2");}
if(a == "111"){printf("3");}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: expected primary-expression before ',' token
   10 | if(a == "001"),(a == "010"),(a == "100"){printf("1");}
      |               ^
a.cc:11:15: error: expected primary-expression before ',' token
   11 | if(a == "011"),(a == "101"),(a == "110"){printf("2");}
      |               ^
Language: C++

#include<iostream>
using namespace std; 
 
 
int main()
{
string a;
cin >> a 
if(a == "000"){printf("0");}
if(a == "001"){printf("1");}
if(a == "010"){printf("1");}
if(a == "011"){printf("2");}
if(a == "100"){printf("1");}
if(a == "101"){printf("2");}
if(a == "110"){printf("2");}
if(a == "111"){printf("3");}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: expected ';' before 'if'
    8 | cin >> a
      |         ^
      |         ;
    9 | if(a == "000"){printf("0");}
      | ~~
Language: C++

function Main(input) {
    input = input.split('').map(n=>parseInt(n));
    a = input[0];
    b = input[1];
    c = input[2];
    console.log(a+b+c);
    
    }
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Compiler output:
a.cc:2:25: error: empty character constant
    2 |     input = input.split('').map(n=>parseInt(n));
      |                         ^~
a.cc:9:14: warning: multi-character character constant [-Wmultichar]
    9 | Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
      |              ^~~~
a.cc:9:33: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
    9 | Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
      |                                 ^~~~~~~~~~~~
a.cc:9:47: warning: multi-character character constant [-Wmultichar]
    9 | Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
      |                                               ^~~~~~
a.cc:1:1: error: 'function' does not name a type; did you mean 'union'?
    1 | function Main(input) {
      | ^~~~~~~~
      | union
a.cc:9:5: error: expected constructor, destructor, or type conversion before '(' token
    9 | Main(require('fs').readFileSync('/dev/stdin', 'utf8'));
      |     ^
Language: C

#include<stdio.h>
#include<stdlib.h>

int main(int argc,char** argv)
{
	char a[10];
	scanf("%s",a);
	count = 0;
	for(int i = 0; i < 3; i++){
		if(a[i]=='1'){
			count = count + 1;
		}
	}
	printf("%d\n",count );
	return(0);
}

Compiler output:
main.c: In function 'main':
main.c:8:9: error: 'count' undeclared (first use in this function)
    8 |         count = 0;
      |         ^~~~~
main.c:8:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int answer =0;
		int s =  sc.nextInt();
		if(s == 1){
			answer = answer + 1;
		}
		int t =  sc.nextInt();
		if(t == 1){
			answer = answer + 1;
		}
		int u =  sc.nextInt();
		if(u == 1){
			answer = answer + 1;
		}


		System.out.println(answer);
	}
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main{
      | ^~~~~~
Language: Java

import java.util.Scanner;

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

		for(int i=0; i<=2; i++){
			s[i] = sc.nextline();
			if(s[i] == "1"){
				answer++;
			}
		}
		System.out.println(answer);
	}
}


Compiler output:
Main.java:10: error: cannot find symbol
			s[i] = sc.nextline();
			         ^
  symbol:   method nextline()
  location: variable sc of type Scanner
1 error
Language: Java

import java.util.Scanner;

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

		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();

      	int answer = a+b+c;
		System.out.println(answer);
	}
}


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

import java.util.Scanner;

public class Main {

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

        int nums1 =Integer.parseInt(args[0]);
        int nums2 =Integer.parseInt(args[1]);
        int nums3 =Integer.parseInt(args[2]);

        int sum = nums1 + nums2 + nums3;
         System.out.println(sum);
    }
}

Compiler output:
Main.java:7: error: variable args is already defined in method main(String[])
        String[] args = sc.next().split("");
                 ^
1 error
Language: C++

# -*- coding: utf-8 -*-

import sys

s = raw_input().split()[0]

n = 0
for c in s:
    if c == '1':
        n += 1

sys.stdout.write('%d\n' % n)
sys.stdout.flush()


Compiler output:
a.cc:1:3: error: invalid preprocessing directive #-
    1 | # -*- coding: utf-8 -*-
      |   ^
a.cc:12:18: warning: multi-character character constant [-Wmultichar]
   12 | sys.stdout.write('%d\n' % n)
      |                  ^~~~~~
a.cc:3:1: error: 'import' does not name a type
    3 | import sys
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: expected ';' before '}' token
   11 |       ++i
      |          ^
      |          ;
   12 |     }
      |     ~
Language: C++

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

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



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

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: expected ';' before '}' token
   11 |       ++i
      |          ^
      |          ;
   12 |     }
      |     ~
Language: C++

#include <iostream>
using namespace std;
int main(){
int a,a100,a10,a1,kazu;
cin >> a;
a100 = a / 100;
a10 = (a-b) / 10;
a1 = a-b-c;
kazu = a100 + a10 + a1;
cout << kazu << endl;
}

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

#include <iostream>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <vector>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <queue>
#include <cmath>
#include <cstdio>
using namespace std;
int a[200];
int main(){
int b,ans=0;
cin>>b;
for(iny i=0;i<b;i++)
cin>>a[i];
for(iny i=0;i<b;i++)
if(a[i]%2==1)
{cout<<ans;
system("pause");
return 0;
}
for(iny i=0;i<b;i++){
a[i]=a[i]/2;
if(a[i]%2==1)
{cout<<i+1;
system("pause");
return 0;
}}
system("pause");
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'iny' was not declared in this scope; did you mean 'int'?
   18 | for(iny i=0;i<b;i++)
      |     ^~~
      |     int
a.cc:18:13: error: 'i' was not declared in this scope
   18 | for(iny i=0;i<b;i++)
      |             ^
a.cc:20:5: error: 'iny' was not declared in this scope; did you mean 'int'?
   20 | for(iny i=0;i<b;i++)
      |     ^~~
      |     int
a.cc:20:13: error: 'i' was not declared in this scope
   20 | for(iny i=0;i<b;i++)
      |             ^
a.cc:26:5: error: 'iny' was not declared in this scope; did you mean 'int'?
   26 | for(iny i=0;i<b;i++){
      |     ^~~
      |     int
a.cc:26:13: error: 'i' was not declared in this scope
   26 | for(iny i=0;i<b;i++){
      |             ^
Language: C++

#include <iostream>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <vector>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <queue>
#include <cmath>
#include <cstdio>
using namespace std;
int main(){
int a,b=0;
cin>>a;
for(int i=0;i<3;i++)
if(a[i]==1)
b++;
cout<<b;
system("pause");
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: invalid types 'int[int]' for array subscript
   18 | if(a[i]==1)
      |     ^
Language: Java

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int count = 0;
		for(char c : s.toCharArray()) {
			if(c=='1') count++;
		}
		System.out.println(count);
	}
}


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

#include "bits/stdc++.h"

#define rep(a,b) for(int a = 0;a < b;a++)
#define REP(i, x, n) for(int i = x; i < n; i++)
#define P(a) cout << a << endl
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define ssort(v) sort(v.begin(),v.end())
#define rev(v) reverse(v.begin(),v.end())
#define vP(v) for(int i = 0;i < v.size();i++){cout << v[i];if(i != v.size()-1)cout << endl;}
#define vcin(v,n) rep(i,n){int a;cin >> a;v.pb(a);}

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int dx[] = { 1, -1 , 0 , 0 };
int dy[] = { 0,  0,  1, -1 };
ll MOD = 1000000007;

void solve(){
	string s;
	cin >> s;
	int count = 0;
	rep(i,s.length()){
		if(s[i] == '1')count++
	}
	P(count);
}

int main() {
    solve();
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:25:39: error: expected ';' before '}' token
   25 |                 if(s[i] == '1')count++
      |                                       ^
      |                                       ;
   26 |         }
      |         ~
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Test081 {
	
	public static void main(String[] args) throws Exception {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String input = br.readLine();
		int count = 0;
		for(int i=0; i<input.length(); i++) {
			if(input.charAt(i) == '1') count++;
		}
		System.out.println(count);
		
		
	}

}


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

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

Compiler output:
a.cc:3:9: error: expected unqualified-id before 'for'
    3 |         for (int i = 0; i < 3; ++i)
      |         ^~~
a.cc:3:25: error: 'i' does not name a type
    3 |         for (int i = 0; i < 3; ++i)
      |                         ^
a.cc:3:32: error: expected unqualified-id before '++' token
    3 |         for (int i = 0; i < 3; ++i)
      |                                ^~
a.cc:7:9: error: expected unqualified-id before 'for'
    7 |         for (int i = 0; i < 3; ++i)
      |         ^~~
a.cc:7:25: error: 'i' does not name a type
    7 |         for (int i = 0; i < 3; ++i)
      |                         ^
a.cc:7:32: error: expected unqualified-id before '++' token
    7 |         for (int i = 0; i < 3; ++i)
      |                                ^~
a.cc:14:9: error: expected unqualified-id before 'for'
   14 |         for (int i = 0; i < 3; ++i)
      |         ^~~
a.cc:14:25: error: 'i' does not name a type
   14 |         for (int i = 0; i < 3; ++i)
      |                         ^
a.cc:14:32: error: expected unqualified-id before '++' token
   14 |         for (int i = 0; i < 3; ++i)
      |                                ^~
a.cc:18:5: error: expected unqualified-id before 'return'
   18 |     return 0;
      |     ^~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: unable to find numeric literal operator 'operator""\U0000ff1bi'
    6 | for(int i=0;i<=3；i++)
      |                ^~~~
a.cc:6:22: error: expected ';' before ')' token
    6 | for(int i=0;i<=3；i++)
      |                      ^
      |                      ;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: unable to find numeric literal operator 'operator""\U0000ff1bi'
    6 | for(int i=0;i<=3；i++)
      |                ^~~~
a.cc:6:22: error: expected ';' before ')' token
    6 | for(int i=0;i<=3；i++)
      |                      ^
      |                      ;
a.cc:7:9: error: invalid types 'int[int]' for array subscript
    7 | { cin>>s[i];
      |         ^
a.cc:8:7: error: invalid types 'int[int]' for array subscript
    8 |   if(s[i]==1)
      |       ^
Language: C++

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

Compiler output:
a.cc:5:8: error: expected primary-expression before 's'
    5 | string s;
      |        ^
a.cc:5:8: error: expected '}' before 's'
a.cc:4:13: note: to match this '{'
    4 | int main（）{
      |             ^
a.cc:7:1: error: 'cin' does not name a type
    7 | cin>>s;
      | ^~~
a.cc:8:1: error: expected unqualified-id before 'for'
    8 | for(int i=0;i<s.size();i++)
      | ^~~
a.cc:8:13: error: 'i' does not name a type
    8 | for(int i=0;i<s.size();i++)
      |             ^
a.cc:8:24: error: 'i' does not name a type
    8 | for(int i=0;i<s.size();i++)
      |                        ^
a.cc:11:1: error: 'cout' does not name a type
   11 | cout>>cnt;
      | ^~~~
a.cc:12:1: error: expected unqualified-id before 'return'
   12 | return 0;
      | ^~~~~~
a.cc:13:1: error: expected declaration before '}' token
   13 | }
      | ^
Language: C++

(setq a (read))
(setq b (+ (truncate (/ a 100)) (mod (truncate (/ a 10)) 10) (mod a 10)))
(print b)

Compiler output:
a.cc:1:6: error: expected ')' before 'a'
    1 | (setq a (read))
      | ~    ^~
      |      )
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   rep(i, s.size()) {
      |       ^
a.cc:8:3: error: 'rep' was not declared in this scope
    8 |   rep(i, s.size()) {
      |   ^~~
Language: C++

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

int main()
{
	int a[i];
	int i,s1,s2,s3,t;
	for(i=0;i<=2;i++) cin>>a[i];
	
	s1=a[0];
	s2=a[1];
	s3=a[3];
	if(s1==1) t++;
	if(s2==1) t++;
	if(s3==2) t++;
	
	cout<<t<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: 'i' was not declared in this scope
    8 |         int a[i];
      |               ^
a.cc:10:32: error: 'a' was not declared in this scope
   10 |         for(i=0;i<=2;i++) cin>>a[i];
      |                                ^
a.cc:12:12: error: 'a' was not declared in this scope
   12 |         s1=a[0];
      |            ^
Language: C++

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

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

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

#include<iostream>
#include<cstdio>
#include<algortihm>
using namespace std;
int a[200001];
int an(int i,int j)
{
return i>j;
}
int main()
{
int n,k,i,x;
cin>>n>>k;
for(i=0;i<n;i++)
{
cin>>x;
a[x]++;
}
sort(a,a+n.an);
x=0;
for(i=k;i<=n;i++)
x+=a[i];
cout<<x;
return 0;
}

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

#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(x,y) (x=min(x,y))
#define chmax(x,y) (x=max(x,y))
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}

int main(){
	string s;
	cin>>s;
	int a = 0;
	for(auto c: s[i]) a += c-'0';
	cout<<a<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:23: error: 'i' was not declared in this scope
   45 |         for(auto c: s[i]) a += c-'0';
      |                       ^
Language: C++

#include <iostegfedsbhsn 
dsjhjjws
udnd n

Compiler output:
a.cc:1:26: error: missing terminating > character
    1 | #include <iostegfedsbhsn
      |                          ^
a.cc:1:10: fatal error: iostegfedsbhsn: No such file or directory
    1 | #include <iostegfedsbhsn
      |          ^
compilation terminated.
Language: C++

15而然通威股份把电话回访你cfhhbfbfkjdjjdf'dikfkjkd

对你父母难道没fd

发；dkfkdkvmmfdfdlldf

gfjdjgfndnvjdjvnfjddkkikkdjxfdjmmf




Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 15而然通威股份把电话回访你cfhhbfbfkjdjjdf'dikfkjkd
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

int mian()
{
	int a[3],c=0;
	for (int i=1;i<=3;i++)
	{
		cin >> a[i];
	    if (a[i]==1)
	        c++;
	}
	cout << c;
	return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
using namespace std;

int mian()
{
	int a[3],c;
	for (int i=1;i<=3;i++)
	{
		cin >> a[i];
	    if (a[i]==1)
	        c++;
	}
	cout << c;
	return 0;
	
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
using namespace std;
int main() {
	int s,sum;
	cin>>s;
	
	while(s!=0)
	{
		sum+=s%10;
		s=s/10;
	}
	
	cout<<sum;
	return 0； 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: unable to find numeric literal operator 'operator""\U0000ff1b'
   14 |         return 0；
      |                ^~~
a.cc:14:19: error: expected ';' before '}' token
   14 |         return 0；
      |                   ^
      |                   ;
   15 | }
      | ~
Language: C++

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

string s;
int cnt=0;

cin >> s;

if (s[0]==1) cnt++;
if (s[1]==1) cnt++;
if (s[2]==1) cnt++;

cout << cnt;
return 0;

Compiler output:
a.cc:7:1: error: 'cin' does not name a type
    7 | cin >> s;
      | ^~~
a.cc:9:1: error: expected unqualified-id before 'if'
    9 | if (s[0]==1) cnt++;
      | ^~
a.cc:10:1: error: expected unqualified-id before 'if'
   10 | if (s[1]==1) cnt++;
      | ^~
a.cc:11:1: error: expected unqualified-id before 'if'
   11 | if (s[2]==1) cnt++;
      | ^~
a.cc:13:1: error: 'cout' does not name a type
   13 | cout << cnt;
      | ^~~~
a.cc:14:1: error: expected unqualified-id before 'return'
   14 | return 0;
      | ^~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: expected ';' before 'if'
    7 |         cin>>s
      |               ^
      |               ;
    8 |         if(s[0]==1) cnt++;
      |         ~~
Language: C++

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

Compiler output:
a.cc:1:21: warning: extra tokens at end of #include directive
    1 | #include <iostream> #include <string>
      |                     ^
a.cc:6:11: error: extended character ’ is not valid in an identifier
    6 | if (s[0]==’1’) if (s[1]==’1’) if (s[2]==’1’)
      |           ^
a.cc:6:11: error: extended character ’ is not valid in an identifier
a.cc:6:26: error: extended character ’ is not valid in an identifier
    6 | if (s[0]==’1’) if (s[1]==’1’) if (s[2]==’1’)
      |                          ^
a.cc:6:26: error: extended character ’ is not valid in an identifier
a.cc:6:41: error: extended character ’ is not valid in an identifier
    6 | if (s[0]==’1’) if (s[1]==’1’) if (s[2]==’1’)
      |                                         ^
a.cc:6:41: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:6:11: error: '\U000020191\U00002019' was not declared in this scope
    6 | if (s[0]==’1’) if (s[1]==’1’) if (s[2]==’1’)
      |           ^~~
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:13:1: error: '\U0000fffc' does not name a type
   13 | ￼
      | ^
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;
      |                     ^
a.cc:2:1: error: 'string' does not name a type; did you mean 'stdin'?
    2 | string s;
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |     cin >> s;
      |     ^~~
      |     std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:4:12: error: 's' was not declared in this scope
    4 |     cin >> s;
      |            ^
a.cc:5:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
    5 |     if(s[0]=='1') ans++;
      |                   ^~~
      |                   abs
a.cc:6:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
    6 |     if(s[1]=='1') ans++;
      |                   ^~~
      |                   abs
a.cc:7:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
    7 |     if(s[2]=='1') ans++;
      |                   ^~~
      |                   abs
a.cc:8:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |     cout << ans << 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:8:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |     cout << ans << endl;
      |             ^~~
      |             abs
a.cc:8:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    8 |     cout << ans << 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)
      |     ^~~~
a.cc: At global scope:
a.cc:10:1: error: '\U0000fffc' does not name a type
   10 | ￼
      | ^