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

#include<iostream>
#include<string>

useing namespase std;

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

int cnt = 0;
if(s[0] == "1") cnt++;
if(s[1] == "1") cnt++;
if(s[2] == "1") cnt++;
cout << cnt << endl;

return 0;
}

Compiler output:
a.cc:4:1: error: 'useing' does not name a type
    4 | useing namespase std;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:8:1: error: 'string' was not declared in this scope
    8 | string s;
      | ^~~~~~
a.cc:8:1: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:9:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 | cin>>s;
      | ^~~
      | std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:6: error: 's' was not declared in this scope
    9 | cin>>s;
      |      ^
a.cc:15:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 | cout << cnt << 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 << cnt << endl;
      |                ^~~~
      |                std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: expected initializer before '==' token
    9 |   int counter == 0
      |               ^~
a.cc:12:21: error: 'counter' was not declared in this scope
   12 |   if(s[1] == '1') ++counter;
      |                     ^~~~~~~
a.cc:13:21: error: 'counter' was not declared in this scope
   13 |   if(s[2] == '1') ++counter;
      |                     ^~~~~~~
a.cc:15:11: error: 'counter' was not declared in this scope
   15 |   cout << counter << endl;
      |           ^~~~~~~
Language: C++

#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main() {
	string s;
	cin >> s;
	cout << count(s.begin(), s.end(), '1');
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:22: error: expected ';' before ')' token
    6 |   for(int i=0;i<3,i++){
      |                      ^
      |                      ;
a.cc:10:22: error: expected ';' before ')' token
   10 |   for(int i=0;i<3,i++){
      |                      ^
      |                      ;
Language: C++

#include <iostream>
using namespace std;
 
int main(){
  vector<int> masu(3);
  for(int i=0;i<3,i++){
    cin >> masu.at(i);
  }
  int count = 0;
  for(int i=0;i<3,i++){
    if(masu.at(i)==1){
      count++;}
  }
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'vector' was not declared in this scope
    5 |   vector<int> masu(3);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:5:10: error: expected primary-expression before 'int'
    5 |   vector<int> masu(3);
      |          ^~~
a.cc:6:22: error: expected ';' before ')' token
    6 |   for(int i=0;i<3,i++){
      |                      ^
      |                      ;
a.cc:7:12: error: 'masu' was not declared in this scope
    7 |     cin >> masu.at(i);
      |            ^~~~
a.cc:10:22: error: expected ';' before ')' token
   10 |   for(int i=0;i<3,i++){
      |                      ^
      |                      ;
a.cc:11:8: error: 'masu' was not declared in this scope
   11 |     if(masu.at(i)==1){
      |        ^~~~
Language: C++

#inclde <iostream>
using namespace std;
 
int main(){
  vector<int> masu(3);
  for(int i=0;i<3,i++){
    cin >> masu.at(i);
  }
  int count = 0;
  for(int i=0;i<3,i++){
    if(masu.at(i)==1){
      count++;}
  }
  cout << count << endl;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inclde; did you mean #include?
    1 | #inclde <iostream>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:3: error: 'vector' was not declared in this scope
    5 |   vector<int> masu(3);
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #inclde <iostream>
a.cc:5:10: error: expected primary-expression before 'int'
    5 |   vector<int> masu(3);
      |          ^~~
a.cc:6:22: error: expected ';' before ')' token
    6 |   for(int i=0;i<3,i++){
      |                      ^
      |                      ;
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin >> masu.at(i);
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inclde <iostream>
a.cc:7:12: error: 'masu' was not declared in this scope
    7 |     cin >> masu.at(i);
      |            ^~~~
a.cc:10:22: error: expected ';' before ')' token
   10 |   for(int i=0;i<3,i++){
      |                      ^
      |                      ;
a.cc:11:8: error: 'masu' was not declared in this scope
   11 |     if(masu.at(i)==1){
      |        ^~~~
a.cc:14:3: error: 'cout' was not declared in this scope
   14 |   cout << count << endl;
      |   ^~~~
a.cc:14:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:20: error: 'endl' was not declared in this scope
   14 |   cout << count << endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inclde <iostream>
Language: C++

#inclde <iostream>
using namespace std;

int main(){
  vector<int> masu(3);
  for(int i=0;i<3,i++){
    cin >> masu.at(i);
  }
  int count = 0;
  for(int i=0;i<3,i++){
    if(masu.at(i)==1){
      count++;}
  }
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inclde; did you mean #include?
    1 | #inclde <iostream>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:3: error: 'vector' was not declared in this scope
    5 |   vector<int> masu(3);
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #inclde <iostream>
a.cc:5:10: error: expected primary-expression before 'int'
    5 |   vector<int> masu(3);
      |          ^~~
a.cc:6:22: error: expected ';' before ')' token
    6 |   for(int i=0;i<3,i++){
      |                      ^
      |                      ;
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin >> masu.at(i);
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inclde <iostream>
a.cc:7:12: error: 'masu' was not declared in this scope
    7 |     cin >> masu.at(i);
      |            ^~~~
a.cc:10:22: error: expected ';' before ')' token
   10 |   for(int i=0;i<3,i++){
      |                      ^
      |                      ;
a.cc:11:8: error: 'masu' was not declared in this scope
   11 |     if(masu.at(i)==1){
      |        ^~~~
Language: C++

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

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


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

#include <iostream>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: expected identifier before numeric constant
    6 |         char[3] s;
      |              ^
a.cc:6:14: error: expected ']' before numeric constant
    6 |         char[3] s;
      |              ^
      |              ]
a.cc:6:13: error: structured binding declaration cannot have type 'char'
    6 |         char[3] s;
      |             ^
a.cc:6:13: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:6:13: error: empty structured binding declaration
a.cc:6:17: error: expected initializer before 's'
    6 |         char[3] s;
      |                 ^
a.cc:7:16: error: 's' was not declared in this scope
    7 |         cin >> s[0] >> s[2] >> s[3];
      |                ^
Language: C++

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> a >> b >> c;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:16:3: error: 'cout' was not declared in this scope
   16 |   cout << sum << endl;
      |   ^~~~
a.cc:16:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:18: error: 'endl' was not declared in this scope
   16 |   cout << sum << endl;
      |                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C

#include <iostream>
#include <string>

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

	int sum = 0;
	for( int i = 0; i < s.size(); i++ ) {
		sum += s[ i ] - '0';
	}

	std::cout << sum << std::endl;
	return 0;
}


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

#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
X#include <numeric>
#include <tuple>
#include <bitset>
#define _USE_MATH_DEFINES
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
ll inf = llmax / 2;

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


Compiler output:
a.cc:11:2: error: stray '#' in program
   11 | X#include <numeric>
      |  ^
a.cc:11:1: error: 'X' does not name a type
   11 | X#include <numeric>
      | ^
In file included from a.cc:13:
/usr/include/c++/14/bitset:1717:33: error: 'bitset' is not a member of 'std'
 1717 |     struct hash<_GLIBCXX_STD_C::bitset<_Nb>>
      |                                 ^~~~~~
/usr/include/c++/14/bitset:63:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
   62 | #include <bits/version.h>
  +++ |+#include <bitset>
   63 | 
/usr/include/c++/14/bitset:1717:40: error: template argument 1 is invalid
 1717 |     struct hash<_GLIBCXX_STD_C::bitset<_Nb>>
      |                                        ^~~
/usr/include/c++/14/bitset:1717:43: error: expected unqualified-id before '>' token
 1717 |     struct hash<_GLIBCXX_STD_C::bitset<_Nb>>
      |                                           ^~
/usr/include/c++/14/bitset:1729:33: error: 'bitset' is not a member of 'std'
 1729 |     struct hash<_GLIBCXX_STD_C::bitset<0>>
      |                                 ^~~~~~
/usr/include/c++/14/bitset:1729:33: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
/usr/include/c++/14/bitset:1729:40: error: template argument 1 is invalid
 1729 |     struct hash<_GLIBCXX_STD_C::bitset<0>>
      |                                        ^
/usr/include/c++/14/bitset:1729:41: error: expected unqualified-id before '>' token
 1729 |     struct hash<_GLIBCXX_STD_C::bitset<0>>
      |                                         ^~
Language: C

#include<stdio.h>
int main(void){
	int N,A[201],i,cnt=-1,flag=1;
	scanf("%d",&N);
	for(i=0;i<n;i++)scanf("%d",&A[i]);
	while(flag==1){
		for(i=0;i<N;i++){
			if(A[i]%2==1)flag=0;
			A[i]/=2;
		}
	cnt++;
	}
	printf("%d\n",cnt);
	return 0;
}
	


Compiler output:
main.c: In function 'main':
main.c:5:19: error: 'n' undeclared (first use in this function)
    5 |         for(i=0;i<n;i++)scanf("%d",&A[i]);
      |                   ^
main.c:5:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(){
    int a[3],count = 0;
    scanf("%d",&a);

        if(a0=='1')count++;
        if(a1=='1')count++;
        if(a2=='1')count++;
    printf("%d\n",count);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:12: error: 'a0' undeclared (first use in this function); did you mean 'a'?
    6 |         if(a0=='1')count++;
      |            ^~
      |            a
main.c:6:12: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:12: error: 'a1' undeclared (first use in this function); did you mean 'a'?
    7 |         if(a1=='1')count++;
      |            ^~
      |            a
main.c:8:12: error: 'a2' undeclared (first use in this function); did you mean 'a'?
    8 |         if(a2=='1')count++;
      |            ^~
      |            a
Language: C

#include<stdio.h>
int main(){
    int a[3],count = 0;
    scanf("%d",a);

        if(a0=='1')count++;
        if(a1=='1')count++;
        if(a2=='1')count++;
    printf("%d\n",count);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:12: error: 'a0' undeclared (first use in this function); did you mean 'a'?
    6 |         if(a0=='1')count++;
      |            ^~
      |            a
main.c:6:12: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:12: error: 'a1' undeclared (first use in this function); did you mean 'a'?
    7 |         if(a1=='1')count++;
      |            ^~
      |            a
main.c:8:12: error: 'a2' undeclared (first use in this function); did you mean 'a'?
    8 |         if(a2=='1')count++;
      |            ^~
      |            a
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:7:18: error: expected ';' before ')' token
    7 |   for(i=0,i<3,i++){
      |                  ^
      |                  ;
main.c:7:18: error: expected expression before ')' token
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:7:18: error: expected ';' before ')' token
    7 |   for(i=0,i<3,i++){
      |                  ^
      |                  ;
main.c:7:18: error: expected expression before ')' token
main.c:9:14: error: expected ';' before '}' token
    9 |       count++
      |              ^
      |              ;
   10 |     }
      |     ~
Language: C

#include<stdio.h>
int main(){
  int a,b,c;
  scanf("%d%d%d",&a,&b,&c);
  
  if((a==1 && b==1 && c==1)){
    printf("%d",3);
  }else if((a==0 && b==1 && c==1) ||
           (a==1 && b==0 && c==1) ||
           (a==1 && b==1 && c==0) ){
    printf("%d",2);
   else if((a==1 && b==0 && c==0) ||
           (a==0 && b==1 && c==0) ||
           (a==0 && b==0 && c==1) ){
     printf("%d",1);
   }
    return 0;
  }
     

Compiler output:
main.c: In function 'main':
main.c:12:4: error: expected '}' before 'else'
   12 |    else if((a==1 && b==0 && c==0) ||
      |    ^~~~
Language: C++

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

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

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

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

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

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

#include <iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:29: error: expected primary-expression before ';' token
    7 |         cout << 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();
    int count = 0;

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

    System.out.print(count)
  }
}


Compiler output:
Main.java:14: error: ';' expected
    System.out.print(count)
                           ^
1 error
Language: C++

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


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


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

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <complex>
#include <fstream>
#include <cmath>

using namespace std;

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


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

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

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


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

import java.util.Scanner;
public class test {

	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		String str = scan.next();
		int ans = 0;
		for(char a :str.toCharArray()){
			if(a == '1'){
				ans ++;
			}
		}
	}
}

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

	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		String str = scan.next();
		int ans = 0;
		for(char a :str.toCharArray()){
			if(a == '1'){
				ans ++;
			}
		}
	}

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 (){
  string s;
  int a;
  a = 0;
  cin >> s;
  if s.at(0) == 1; a+=1;
  if s.at(1) == 1; a+=1;
  if s.at(2) == 1; a+=1;
  cout << a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:6: error: expected '(' before 's'
    8 |   if s.at(0) == 1; a+=1;
      |      ^
      |      (
a.cc:9:6: error: expected '(' before 's'
    9 |   if s.at(1) == 1; a+=1;
      |      ^
      |      (
a.cc:10:6: error: expected '(' before 's'
   10 |   if s.at(2) == 1; a+=1;
      |      ^
      |      (
Language: C++

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

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


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

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

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


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

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

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


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: expected ';' before 'c'
    7 |   b = a / 100
      |              ^
      |              ;
    8 |   c = (a - b * 100) / 10
      |   ~           
a.cc:10:29: error: expected '}' at end of input
   10 |   cout << b + c + d << endl;
      |                             ^
a.cc:4:13: note: to match this '{'
    4 | int main () {
      |             ^
Language: C++

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

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

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

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


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

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

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


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

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

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

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

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

int main(){
	char a,b,c;
    int i,j,k;
    cin >> a >> b >> c;
    i = a - "0"
    j = b - "0"
    k = c - "0"
    cout << i+j+k ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: invalid operands of types 'char' and 'const char [2]' to binary 'operator-'
    8 |     i = a - "0"
      |         ~ ^ ~~~
      |         |   |
      |         |   const char [2]
      |         char
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {    
	Scanner sc = new Scanner(System.in);
    String str = sc.nextLine();
    if(str.contains("1")) {
      int num = str.lastIndexOf("1") - str.IndexOf("1") + 1;
      System.out.println(n);
    } else {
      System.out.println(0);
    }
  }
}

Compiler output:
Main.java:8: error: cannot find symbol
      int num = str.lastIndexOf("1") - str.IndexOf("1") + 1;
                                          ^
  symbol:   method IndexOf(String)
  location: variable str of type String
Main.java:9: error: cannot find symbol
      System.out.println(n);
                         ^
  symbol:   variable n
  location: class Main
2 errors
Language: C++

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

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


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

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

int main() {
  int s1,s2,s3;
  cin >> s1 >> s2 >> s3;
  cout << a%2+b%2+c%2 << endl;
}


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

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


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

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


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

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


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

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


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

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


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

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

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:10: error: expected identifier before numeric constant
    4 |     int [3] s;
      |          ^
a.cc:4:10: error: expected ']' before numeric constant
    4 |     int [3] s;
      |          ^
      |          ]
a.cc:4:9: error: structured binding declaration cannot have type 'int'
    4 |     int [3] s;
      |         ^
a.cc:4:9: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:4:9: error: empty structured binding declaration
a.cc:4:13: error: expected initializer before 's'
    4 |     int [3] s;
      |             ^
a.cc:7:14: error: 's' was not declared in this scope
    7 |         cin>>s[i]
      |              ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'sum' was not declared in this scope
   12 |   cout<<sum<<endl;
      |         ^~~
Language: C++

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

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

#include<iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: expected ';' before 'if'
    8 |   c = a++
      |          ^
      |          ;
    9 |   if (c = 1){
      |   ~~      
a.cc:11:5: error: 'else' without a previous 'if'
   11 |   } else if (b = 0) {
      |     ^~~~
Language: C++

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

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

#include<iostream>
 
using namespace std;
 
int main(){
  string n[3];
  cin>>n[0]>>n[1]>>n[2];
  int count=0;
  if(n[0]=="1")count++;
  if(n[1]=="1")count++;
  if(n[2]=="1")count++;
  cout<<counter;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'counter' was not declared in this scope; did you mean 'count'?
   12 |   cout<<counter;
      |         ^~~~~~~
      |         count
Language: C++

#include<iostream>
 
using namespace std;
 
int main(){
  string n[3];
  cin>>n[0]>>n[1]>>n[2];
  int counter=0;
  if(n[0]=="1")couter++;
  if(n[1]=="1")couter++;
  if(n[2]=="1")couter++;
  cout<<counter;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: 'couter' was not declared in this scope; did you mean 'counter'?
    9 |   if(n[0]=="1")couter++;
      |                ^~~~~~
      |                counter
a.cc:10:16: error: 'couter' was not declared in this scope; did you mean 'counter'?
   10 |   if(n[1]=="1")couter++;
      |                ^~~~~~
      |                counter
a.cc:11:16: error: 'couter' was not declared in this scope; did you mean 'counter'?
   11 |   if(n[2]=="1")couter++;
      |                ^~~~~~
      |                counter
Language: C++

#include <iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: 'r' was not declared in this scope
    6 |     cin >> r >> g >> b;
      |            ^
a.cc:6:17: error: 'g' was not declared in this scope
    6 |     cin >> r >> g >> b;
      |                 ^
a.cc:6:22: error: 'b' was not declared in this scope
    6 |     cin >> r >> g >> b;
      |                      ^
Language: C++

#include <iostream>
#include <string>
int main() {
	std::string s;
	std::cin >> s;
	int num = 0;
	for (int i = 0; i < s.size(); i++)
		num += int(s[i] - '0');
	std::cout << num << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:29: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |         std::cout << num << endl;
      |                             ^~~~
      |                             std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    char s[4];
    int m,i;
    m=0;
    cin>>s;
    for(i=0;i<strlen(s);++i)
    if(s[i]=='1')
      sum++;
    cout<<sum<<endl;
    return 0;
}

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

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

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

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

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

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

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

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


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

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


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

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


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

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

int main() {
string s;
cin >> s;
int c = 0;
if(s.at(0) == "1"){
	c++;
}
if(s.at(1) == "1"){
	c++;
}
if(s.at(2) == "1"){
	c++;
}
cout << c << 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.at(0) == "1"){
      |    ~~~~~~~~^~~~~~
a.cc:11:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 | if(s.at(1) == "1"){
      |    ~~~~~~~~^~~~~~
a.cc:14:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 | if(s.at(2) == "1"){
      |    ~~~~~~~~^~~~~~
Language: C++

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

int main() {
  int a;
  cin >> a;
  if a=
  cout << a/100+(a-100)/10+(a-110) << endl;
}

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

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

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

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

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


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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   string s;
      |   ^~~~~~
a.cc:4:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin >> s;
      |   ^~~
      |   std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:5:10: error: 's' was not declared in this scope
    5 |   cin >> s;
      |          ^
a.cc:10:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |   cout << counter << 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:10:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   10 |   cout << counter << endl;
      |                      ^~~~
      |                      std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

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

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

int main() {
  int R,;
  cin >>R ;
  cout << R%3 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: expected unqualified-id before ';' token
    5 |   int R,;
      |         ^
Language: C++

#include <iostream>
using namespace std;
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:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |   if (s[0]== "1")++counter;
a.cc:8:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |   if (s[1]== "1")++counter;
a.cc:9:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |   if (s[2]== "1")++counter;
Language: C++

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:4:3: error: 'string' was not declared in this scope
    4 |   string s;
      |   ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> s;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:5:10: error: 's' was not declared in this scope
    5 |   cin >> s;
      |          ^
a.cc:10:3: error: 'cout' was not declared in this scope
   10 |   cout << counter << endl;
      |   ^~~~
a.cc:10:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:10:22: error: 'endl' was not declared in this scope
   10 |   cout << counter << endl;
      |                      ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: 'N' was not declared in this scope
   11 |   for (int i=0; i<=N-1; i++) {
      |                    ^
a.cc:14:2: error: expected '}' at end of input
   14 | }
      |  ^
a.cc:7:17: note: to match this '{'
    7 | int main (void) {
      |                 ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: 'N' was not declared in this scope
   11 |   for (int i=0; i<=N-1; i++) {
      |                    ^
a.cc:14:2: error: expected '}' at end of input
   14 | }
      |  ^
a.cc:7:17: note: to match this '{'
    7 | int main (void) {
      |                 ^