criyle/codenet-compile-errors huggingface dataset:
Language: Java

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

Compiler output:
Main.java:3: error: cannot find symbol
  public static void main (string[] args) {
                           ^
  symbol:   class string
  location: class Main
Main.java:1: error: package java.until does not exist
import java.until.*;
^
Main.java:4: error: cannot find symbol
    Scanner = new Scanner (System.in);
    ^
  symbol:   variable Scanner
  location: class Main
Main.java:4: error: cannot find symbol
    Scanner = new Scanner (System.in);
                  ^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
    String s = sc.next();
               ^
  symbol:   variable sc
  location: class Main
5 errors
Language: Java

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

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
improt java.until.*;
^
1 error
Language: C++

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

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


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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   12 |     if (text.at[i] = "1") {
      |                ^
Language: C++

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

int main() {
  
  int i, answer;
  cin >> i;
  answer = 0;
  
  for (int j = 0; j < i.size(); j++) {
    
    if (1 == i.at(i)) {
      answer++;
    }
  }
  
  cout << answer << endl;
}
  


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

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

int main() {
  
  int i, answer;
  cin >> i;
  answer = 0;
  
  for (int j = 0, j < i.size(), j++) {
    
    if (1 == i.at(i)) {
      answer++;
    }
  }
  
  cout << answer << endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: expected ';' before '<' token
   10 |   for (int j = 0, j < i.size(), j++) {
      |                    ^~
      |                    ;
a.cc:10:21: error: expected primary-expression before '<' token
   10 |   for (int j = 0, j < i.size(), j++) {
      |                     ^
a.cc:10:25: error: request for member 'size' in 'i', which is of non-class type 'int'
   10 |   for (int j = 0, j < i.size(), j++) {
      |                         ^~~~
a.cc:10:36: error: expected ';' before ')' token
   10 |   for (int j = 0, j < i.size(), j++) {
      |                                    ^
      |                                    ;
a.cc:12:16: error: request for member 'at' in 'i', which is of non-class type 'int'
   12 |     if (1 == i.at(i)) {
      |                ^~
Language: C++

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

int main() {
  
  int i, answer;
  cin >> i;
  answer = 0;
  
  for (j = 0, j < i.size(), j++) {
    
    if (1 == i,at(i)) {
      answer++;
    }
  }
  
  cout << answer << endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: 'j' was not declared in this scope
   10 |   for (j = 0, j < i.size(), j++) {
      |        ^
a.cc:10:21: error: request for member 'size' in 'i', which is of non-class type 'int'
   10 |   for (j = 0, j < i.size(), j++) {
      |                     ^~~~
a.cc:18:1: error: expected primary-expression before '}' token
   18 | }
      | ^
a.cc:17:26: error: expected ')' before '}' token
   17 |   cout << answer << endl;
      |                          ^
      |                          )
   18 | }
      | ~                         
a.cc:10:7: note: to match this '('
   10 |   for (j = 0, j < i.size(), j++) {
      |       ^
a.cc:18:1: error: expected primary-expression before '}' token
   18 | }
      | ^
Language: C++

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

int main() {
  
  int i, answer;
  cin >> i;
  naswer = 0;
  
  for (j = 0, j < i.size(), j++) {
    
    if (1 == i,at(i)) {
      answer++;
    }
  }
  
  cout << answer << endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'naswer' was not declared in this scope; did you mean 'answer'?
    8 |   naswer = 0;
      |   ^~~~~~
      |   answer
a.cc:10:8: error: 'j' was not declared in this scope
   10 |   for (j = 0, j < i.size(), j++) {
      |        ^
a.cc:10:21: error: request for member 'size' in 'i', which is of non-class type 'int'
   10 |   for (j = 0, j < i.size(), j++) {
      |                     ^~~~
a.cc:18:1: error: expected primary-expression before '}' token
   18 | }
      | ^
a.cc:17:26: error: expected ')' before '}' token
   17 |   cout << answer << endl;
      |                          ^
      |                          )
   18 | }
      | ~                         
a.cc:10:7: note: to match this '('
   10 |   for (j = 0, j < i.size(), j++) {
      |       ^
a.cc:18:1: error: expected primary-expression before '}' token
   18 | }
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
 int stone = 0;
 vector<char> str(3);
 
 cin >> str.at(0) >> str.at(1) >> str.at(2);
 
 for (i = 0; i < 3; i++){
   if (str.at(i) == '1') stone++;
 }
 
 cout << stone << endl;
}


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

#include <bits/stdc++.h>

using namespace std;

int main(){
 int stone = 0;
 vector<char> str(3);
 
 cin >> str.at(0) >> str.at(1) >> str.at(2);
 
 for (i = 0; i < 3; i++){
   if (str.at(i)) stone++;
 }
 
 cout << stone << endl;
}

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

#include <bits/stdc++.h>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: expected initializer before 'cin'
    7 |         cin >> s[0] >> s[1] >> s[2];
      |         ^~~
a.cc:11:20: error: 's' was not declared in this scope
   11 |                 if(s[i] == '1') {
      |                    ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: expected initializer before 'cin'
    7 |         cin >> s[0] >> s[1] >> s[2];
      |         ^~~
a.cc:10:20: error: 's' was not declared in this scope
   10 |                 if(s[i] == '1') {
      |                    ^
a.cc:11:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |                         ans++;
      |                         ^~~
      |                         abs
a.cc:14:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C++

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

int main()
{
    int N;
    int A[201];
    cin >> N;
    
    for(int i = 0; i < N; i++)
    {
        cin >> A[i];
    }
    
    int answer = 0;
    bool flag = false;
    while{
        for(int i = 0; i < N; i++){
        if (A[i] % 2 == 0) {
        }
        else{
            flag = true;
            break;
        }
        }

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

         ++answer;
    } while (true);
    
   cout << answer << endl;
    
}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:10: error: expected '(' before '{' token
   18 |     while{
      |          ^
      |          (
a.cc:18:10: error: expected primary-expression before '{' token
a.cc:18:10: error: expected ')' before '{' token
   18 |     while{
      |          ^
      |          )
Language: C++

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

int main()
{
    int N;
    int A[201];
    cin >> N;
    
    for(int i = 0; i < N; i++)
    {
        cin >> A[i];
    }
    
    int answer;
    int flag = 0;
    do{
        for(int i = 0; i < N; i++){
        if (A[i] % 2 == 0) {
        }
        else{
            flag = 1
        }
        
        if (flag) {
            break;
        }
        
        
        for(int i = 0; i < N; i++)
        {
            A[i] = A[i] /2;
        }
        
        
         }
         ++answer;
    } while (true);
    
   cout << answer << endl;
    
}



Compiler output:
a.cc: In function 'int main()':
a.cc:23:21: error: expected ';' before '}' token
   23 |             flag = 1
      |                     ^
      |                     ;
   24 |         }
      |         ~
Language: C++

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

int main()
{
    int N;
    int A[201];
    cin >> N;
    
    for(int i = 0; i < N; i++)
    {
        cin >> A[i];
    }
    
    int answer, flag;
    do{
        for(int i = 0; i < N; i++){
        if (A[i] % 2 == 0) {
        }
        else{
            break;
        }
        
        for(int i = 0; i < N; i++)
        {
            A[i] = A[i] /2
        }
        
        
         }
         ++answer;
    } while (true);
    
   cout << answer << endl;
    
}



Compiler output:
a.cc: In function 'int main()':
a.cc:27:27: error: expected ';' before '}' token
   27 |             A[i] = A[i] /2
      |                           ^
      |                           ;
   28 |         }
      |         ~
Language: C++

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

int main()
{
    int N;
    int A[201];
    cin >> N;
    
    for(int i = 0; i < N; i++)
    {
        cin >> A[i];
    }
    
    int answer, flag;
    do{
        for(int i = 0; i < N; i++){
        if (A[i] % 2 == 0) {
        }else{
            break;
        }
        
        for(int i = 0; i < N; i++)
        {
            A[i] = A[i] /2
        }
        
        
         }
         ++answer;
    } while (true);
    
   cout << answer << endl;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:27: error: expected ';' before '}' token
   26 |             A[i] = A[i] /2
      |                           ^
      |                           ;
   27 |         }
      |         ~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: expected ';' before '}' token
    7 |       cin >>a[i]
      |                 ^
      |                 ;
    8 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,one,two,three;
  cin >> a;
  one = a%2;
  two = (a-one)%100/10;
  three = (a-two*10-one)/100;
  cout << one << teo << three << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: 'teo' was not declared in this scope; did you mean 'two'?
   10 |   cout << one << teo << three << endl;
      |                  ^~~
      |                  two
Language: C++

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |   if(a[0]=="1")++b
a.cc:7:19: error: expected ';' before 'if'
    7 |   if(a[0]=="1")++b
      |                   ^
      |                   ;
    8 |   if(a[1]=="1")++b
      |   ~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'll' was not declared in this scope
    6 |   ll ans=0;
      |   ^~
a.cc:7:9: error: expected ';' before 'i'
    7 |   for(ll i=0;i<3;i++) {
      |         ^~
      |         ;
a.cc:7:14: error: 'i' was not declared in this scope
    7 |   for(ll i=0;i<3;i++) {
      |              ^
a.cc:9:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |       ans++;
      |       ^~~
      |       abs
a.cc:12:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

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

int main() {
  int a;

  cin >> a;

  int b, c;
  
  b = a / 10
  c = b / 10
  
  cout << a % 10 + b % 10 + c % 10 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: expected ';' before 'c'
   11 |   b = a / 10
      |             ^
      |             ;
   12 |   c = b / 10
      |   ~
Language: C++

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

int main() {
  char s[3];
  cin >>s;
  int result=0;
  
  for(int i=0; i<3; ++i) {
    if (s[i]=='1') ++result:
  }
  
  cout << result;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:28: error: expected ';' before ':' token
   10 |     if (s[i]=='1') ++result:
      |                            ^
      |                            ;
Language: C++

  #include<iostream>
  #include<string>
  using namespace std;
  
  int main(){
    string s;
    cin >> s;
    auto count = 0;
    for(auto i = 0; i < s.size(); i++){
      if(s[i] == '1') count++;
    }
    cout << count << "\n";
    return 0;
  }
                                                                                                             ~                                                                                                              ~                                                                                                              ~                                                                                                              ~                      

Compiler output:
a.cc:15:221: error: expected class-name before '~' token
   15 |                                                                                                              ~                                                                                                              ~                                                                                                              ~                                                                                                              ~
      |                                                                                                                                                                                                                             ^
Language: Java

    public static void main(String[] args) {
    	FastScanner sc = new FastScanner();
    	String a = sc.next();
    	int count = 0;
    	for(char x:a.toCharArray()){
    		if(x=='1'){
    			count += 1;
    		}
    	}
    	System.out.println(count);
    }

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: C++

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

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

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

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

  cin >> a;
  cout << ( ( a / 100 ) + ( a % 100 / 10 ) + ( a % 10 ) << endl;
}

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

#include"stdafx.h"
#include<iostream>
#include<string>
using namespace std;

int main() {
	string s;
	cin >> s;
	int counter = 0;
	for (auto&& x : s)if (x == '1')counter++;

	return 0;

}

Compiler output:
a.cc:1:9: fatal error: stdafx.h: No such file or directory
    1 | #include"stdafx.h"
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

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

void main() {
	string s;
	cin >> s;
	int counter;
	for (auto&& x : s)if (x == '1')counter++;

}

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

#include <stdio.h>

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cnt' was not declared in this scope; did you mean 'int'?
    6 |   cnt=0;
      |   ^~~
      |   int
Language: C++

#include <stdio.h>

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

Compiler output:
a.cc:3:11: error: expected initializer before ')' token
    3 | int main()){
      |           ^
Language: C++

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

Compiler output:
a.cc:1:21: warning: extra tokens at end of #include directive
    1 | #include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; int c=0; for(int i=0; i<3; i++){ if(s[i]=='1') c++; } cout << c << endl; return 0; }
      |                     ^
/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(){
  string a;
  cin >> a;
  int cou,k;
  k = a.size();
  for(int i = 0; i < k; i++){
    if(a[i] == "1"){
      cou++;
    }
  }
  cout << cou << 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[i] == "1"){
Language: C++

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

int main(){
  String a[3];
  cin >> a;
  int cou,k;
  k = a.size();
  for(int i = 0; i < k; i++){
    if(a[i] == "1"){
      cou++;
    }
  }
  cout << cou << endl;
}

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

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

int main(){
  String a;
  cin >> a;
  int cou,k;
  k = a.size();
  for(int i = 0; i < k; i++){
    if(a[i] == "1"){
      cou++;
    }
  }
  cout << cou << endl;
}

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: expected ';' before ':' token
   13 |       num1++:
      |             ^
      |             ;
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();
	System.out.println(s.length());
}
}

Compiler output:
Main.java:7: error: method replaceAll in class String cannot be applied to given types;
	s = s.replaceAll();
	     ^
  required: String,String
  found:    no arguments
  reason: actual and formal argument lists differ in length
1 error
Language: C++

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

int main() {
    String a, b, c;

    cin >> a >> b >> c;

    cout << a % 2 + b % 2 + c % 2 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'String' was not declared in this scope
    5 |     String a, b, c;
      |     ^~~~~~
a.cc:7:12: error: 'a' was not declared in this scope
    7 |     cin >> a >> b >> c;
      |            ^
a.cc:7:17: error: 'b' was not declared in this scope
    7 |     cin >> a >> b >> c;
      |                 ^
a.cc:7:22: error: 'c' was not declared in this scope
    7 |     cin >> a >> b >> c;
      |                      ^
Language: Java

import	java.util.*;

public	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.length());
	}
}

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

package abc081;
import java.util.*;
public class A081 {

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

}


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

package abc081;
import java.util.*;
public class A081 {

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

}


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

#include <stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:3:11: error: expected declaration specifiers before ')' token
    3 | int main())
      |           ^
main.c:15: error: expected '{' at end of input
Language: C++

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

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

#include <bits.stdc++.h>
using namespace std;
int main(){
  string s1,s2,s3;
  int ans=0;
  cin << s1 << s2 << s3;
  if(s1=="1")ans++;
  if(s2=="1")ans++;
  if(s3=="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 <bits/stdc++.h>
using namespace std;
 
int main() {
vector<int> mas(3)
  for(int i =0; i <3; i++){
    cin >>mas.at(i);}
  int d =0;
  for(int i =0; i <3; i++){
    if(mas.at(i) ==1){
      d++;}
  }
  cout << d << endl;
}

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

#include <iostream>
using namespace std;

int main(){
  char s[3];
  int count = 0;
  cin >> s;
  for(int i = 0; i < 3; i++){
    if(s[i] == '1'){
      count++;
    }
  }
  cout << count << "\n";
  return 0;
}


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

#include <bits/stdc++.h>

using namespace;

int main(){
	int N, count;
	int a[N];

	cin >> N;
	for(int i = 0; i < N; i++){
		cin >> a[i];
	}
	while(1){
		for(int j = 0; j < N; j++){
			if(a[j]%2 == 0) a[j] = a[j] / 2;
			else break;
		}
		count++;
	}
	cout << count << endl;
}

Compiler output:
a.cc:3:16: error: expected identifier before ';' token
    3 | using namespace;
      |                ^
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |         cin >> N;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 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:20:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |         cout << count << 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:20:26: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   20 |         cout << count << endl;
      |                          ^~~~
      |                          std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

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

import java.util.Scanner;

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

    public static void solve(Scanner sc) {
        char[] a = sc.next().toCharArray();
        int count = 0;
        for (char b : a) {
            if (b == "1") {
                count++;
            }
        }
        System.out.println(count);
    }
}

Compiler output:
Main.java:14: error: bad operand types for binary operator '=='
            if (b == "1") {
                  ^
  first type:  char
  second type: String
1 error
Language: C++

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

int main() {
  string S; 
  cin >> S;
  int Z = 0;
  for (int i = 0; i<S.size(); i++) {
    if (S.at(i) == '0') {
      Z++;
    }
  }
  cont << Z << endl;
}    
  


  




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

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

int main() {
  string S; 
  cin >> S;
  int Z = 0;
  for (int i = 0; i<S.size(); i++) {
    if (s.at(i) == '0') {
      Z++;
    }
  }
  cont << Z << endl;
}    
  


  




Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 's' was not declared in this scope
    9 |     if (s.at(i) == '0') {
      |         ^
a.cc:13:3: error: 'cont' was not declared in this scope; did you mean 'const'?
   13 |   cont << Z << endl;
      |   ^~~~
      |   const
Language: C++

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

int main() {
  string S; 
  cin >> S;
  int Z = 0;
  for (int i = 0; i<S.size(); i++;) {
    if (s.at(i) == '0') {
      Z++;
    }
  }
  cont << Z << endl;
}    
  


  




Compiler output:
a.cc: In function 'int main()':
a.cc:8:34: error: expected ')' before ';' token
    8 |   for (int i = 0; i<S.size(); i++;) {
      |       ~                          ^
      |                                  )
a.cc:8:35: error: expected primary-expression before ')' token
    8 |   for (int i = 0; i<S.size(); i++;) {
      |                                   ^
a.cc:13:3: error: 'cont' was not declared in this scope; did you mean 'const'?
   13 |   cont << Z << endl;
      |   ^~~~
      |   const
Language: Java

public class AtCoder {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		int N = new java.util.Scanner(System.in).nextInt();
		String SecondLine = new java.util.Scanner(System.in).nextLine();
//		String[] ArrayN = SecondLine.split(" "); //見やすい？
		int[] ArrayNint = new int[N];
		for (int i = 0; i < N; i++) {
//			ArrayNint[i] = Integer.parseInt(ArrayN[i]); //見やすい？
			ArrayNint[i]= Integer.parseInt(SecondLine.split(" ")[i]);
		}


		int cnt = 0;
		boolean trigger;
		trigger = true;
		while (trigger) {
			for (int i =0 ; i< ArrayNint.length ; i++ ) {
				if (ArrayNint[i]% 2 == 1) {
					trigger = false ;
					break;
				} else {
					ArrayNint[i] = ArrayNint[i] / 2;
				} // if
			} // for
			if (trigger) {
			cnt++;

			}
		} // while
		System.out.println("Ans is "+cnt);

	}
}


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

#include <bits/stdc++.h>
using namespace std;
 
int main(){
	int a, b, c;
	cin >> a >> b >> c;
	if(a==1){
      int x=1;}
	else {
      int x=0;}
	if(b==1){
      int y=1;}
    else {
      int y=0;}
    if(c==1){
      int z=1;}
    else {
      int z=0;}
    cout << x+y+z <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: 'x' was not declared in this scope
   19 |     cout << x+y+z <<endl;
      |             ^
a.cc:19:15: error: 'y' was not declared in this scope
   19 |     cout << x+y+z <<endl;
      |               ^
a.cc:19:17: error: 'z' was not declared in this scope
   19 |     cout << x+y+z <<endl;
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
	int a, b, c;
	cin >> a >> b >> c;
	if(a=1){
      int x=1;}
	else {
      int x=0;}
	if(b=1){
      int y=1;}
    else {
      int y=0;}
    if(c=1){
      int z=1;}
    else {
      int z=0;}
    cout << x+y+z <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: 'x' was not declared in this scope
   19 |     cout << x+y+z <<endl;
      |             ^
a.cc:19:15: error: 'y' was not declared in this scope
   19 |     cout << x+y+z <<endl;
      |               ^
a.cc:19:17: error: 'z' was not declared in this scope
   19 |     cout << x+y+z <<endl;
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
	int a, b, c;
	cin >> a >> b >> c;
	if(a=1){
      int x=1;}
	else {
      int x=0;}
	if(b=1){
      int y=1;}
    else if{
      int y=0;}
    if(c=1){
      int z=1;}
    if(c=0){
      int z=0;}
    cout << x+y+z <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: expected '(' before '{' token
   13 |     else if{
      |            ^
      |            (
a.cc:19:13: error: 'x' was not declared in this scope
   19 |     cout << x+y+z <<endl;
      |             ^
a.cc:19:15: error: 'y' was not declared in this scope
   19 |     cout << x+y+z <<endl;
      |               ^
a.cc:19:17: error: 'z' was not declared in this scope
   19 |     cout << x+y+z <<endl;
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
	int a, b, c;
	cin >> a >> b >> c;
	if(a=1)
      int x=1;
	else if 
      int x=0;
	if(b=1)
      int y=1;
    else if
      int y=0;
    if(c=1)
      int z=1;
    if(c=0)
      int z=0;
    cout << x+y+z <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: expected '(' before 'int'
   10 |       int x=0;
      |       ^~~
      |       (
a.cc:14:7: error: expected '(' before 'int'
   14 |       int y=0;
      |       ^~~
      |       (
a.cc:19:13: error: 'x' was not declared in this scope
   19 |     cout << x+y+z <<endl;
      |             ^
a.cc:19:15: error: 'y' was not declared in this scope
   19 |     cout << x+y+z <<endl;
      |               ^
a.cc:19:17: error: 'z' was not declared in this scope
   19 |     cout << x+y+z <<endl;
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
	int a, b, c;
	cin >> a >> b >> c;
	if(a=1)
      int x=1;
	else if 
      int x=0
	if(b=1)
      int y=1
    else if
      int y=0
    if(c=1)
      int z=1
    if(c=0)
      int z=0
    cout << x+y+z <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: expected '(' before 'int'
   10 |       int x=0
      |       ^~~
      |       (
Language: C++

#include "pch.h"
#include <iostream>
using namespace std;

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

Compiler output:
a.cc:1:10: fatal error: pch.h: No such file or directory
    1 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C++

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

int main(){
  int s, x, y, z;
  cin >> s;
  
  x = s / 100
  y = s/10 - x*10
  z = s - x*100 - y*10
  
  cout << x+y+z << endl;
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: expected ';' before 'y'
    8 |   x = s / 100
      |              ^
      |              ;
    9 |   y = s/10 - x*10
      |   ~           
a.cc:12:25: error: expected '}' at end of input
   12 |   cout << x+y+z << endl;
      |                         ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int' in initialization
    6 |   int s4 = s1;
      |            ^~
      |            |
      |            std::string {aka std::__cxx11::basic_string<char>}
a.cc:7:12: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int' in initialization
    7 |   int s5 = s2;
      |            ^~
      |            |
      |            std::string {aka std::__cxx11::basic_string<char>}
a.cc:8:12: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int' in initialization
    8 |   int s6 = s3;
      |            ^~
      |            |
      |            std::string {aka std::__cxx11::basic_string<char>}
Language: C++

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

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

#include<iostream>
using namespace std;

int main()
{
	int N[2];
	int count = 0;
	memset(N, 0, sizeof(N));
	for (int i = 0; i <= 2; i++) {
		std::cin >> N[i];
		if (N[i] == 1)count++;
	}
	std::cout << count;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'memset' was not declared in this scope
    8 |         memset(N, 0, sizeof(N));
      |         ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

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

intmain(){
	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:5:1: error: ISO C++ forbids declaration of 'intmain' with no type [-fpermissive]
    5 | intmain(){
      | ^~~~~~~
a.cc: In function 'int intmain()':
a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type]
   13 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

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

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

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

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


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

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

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

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

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: conflicting declaration 'int s'
    7 |         int s = 0;
      |             ^
a.cc:6:16: note: previous declaration as 'std::string s'
    6 |         string s;
      |                ^
a.cc:9:23: error: 'c' was not declared in this scope
    9 |         if(s[0]=='1') c++;
      |                       ^
a.cc:10:23: error: 'c' was not declared in this scope
   10 |         if(s[1]=='1') c++;
      |                       ^
a.cc:11:19: error: 'c' was not declared in this scope
   11 |     if(s[2]=='1') c++;
      |                   ^
a.cc:12:17: error: 'c' was not declared in this scope
   12 |         cout << c << endl;
      |                 ^
Language: C++

#include <iostream>
using namespace std;

int N;
int A[210];         // 最大 200 個なので余裕を持って 210 に --- 200 以上ならなんでもよいです

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

    int res = 0;

    // 操作が行える限り操作を繰り返す
    while (true) {
        bool exist_odd = false;  // A[i] がすべて偶数かどうかを判定するフラグ
        for (int i = 0; i < N; ++i) {
            if (A[i] % 2 != 0) exist_odd = true;  // 奇数があったらフラグを立てる
        }

        if (exist_odd) break;  // 奇数があったら break

        // 操作を行えるなら操作を実際に行う
        for (int i = 0; i < N; ++i) {
            A[i] /= 2;
        }
        ++res;  // 操作回数をインクリメント
    }


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:20:25: error: expected ')' before ';' token
   20 |     if (int i = 0; i < N; ++i) {
      |        ~                ^
      |                         )
a.cc:20:29: error: 'i' was not declared in this scope
   20 |     if (int i = 0; i < N; ++i) {
      |                             ^
Language: C++

#include<iostream>
#include<string>

using namespace std;

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

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