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

#include <iostream>
#inclide <string>


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

Compiler output:
a.cc:2:2: error: invalid preprocessing directive #inclide; did you mean #include?
    2 | #inclide <string>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string s;
      |   ^~~~~~
a.cc:6: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:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   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:7:10: error: 's' was not declared in this scope
    7 |   cin >> s;
      |          ^
Language: C++

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

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

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

int main() {
  // ここにプログラムを追記
  int a, b, c;
  cin >> abc;
  cout << a + b + c << endl;
}

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

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

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


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

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

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

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

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

int main() {
  string a,b,c;
  int ans=0;
  cin >> a >> b >>c;
  if(strcmp(a,'s')==0){
    a++;
  }
  if(strcmp(b,'s')==0){
    a++;
  }
  if(strcmp(c,'s')==0){
    a++;
  }
  cout << ans <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
    8 |   if(strcmp(a,'s')==0){
      |             ^
      |             |
      |             std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:9:6: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
    9 |     a++;
      |     ~^~
a.cc:11:13: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   11 |   if(strcmp(b,'s')==0){
      |             ^
      |             |
      |             std::string {aka std::__cxx11::basic_string<char>}
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:12:6: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   12 |     a++;
      |     ~^~
a.cc:14:13: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   14 |   if(strcmp(c,'s')==0){
      |             ^
      |             |
      |             std::string {aka std::__cxx11::basic_string<char>}
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:15:6: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   15 |     a++;
      |     ~^~
Language: C++

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

int main() {
  string a,b,c;
  int ans=0;
  cin >> a >> b >>c;
  if(strcmp(a,'s')){
    a++;
  }
  if(strcmp(b,'s')){
    a++;
  }
  if(strcmp(c,'s')){
    a++;
  }
  cout << ans <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
    8 |   if(strcmp(a,'s')){
      |             ^
      |             |
      |             std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:9:6: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
    9 |     a++;
      |     ~^~
a.cc:11:13: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   11 |   if(strcmp(b,'s')){
      |             ^
      |             |
      |             std::string {aka std::__cxx11::basic_string<char>}
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:12:6: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   12 |     a++;
      |     ~^~
a.cc:14:13: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   14 |   if(strcmp(c,'s')){
      |             ^
      |             |
      |             std::string {aka std::__cxx11::basic_string<char>}
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:15:6: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   15 |     a++;
      |     ~^~
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:19: error: redeclaration of 'int s_'
    5 |         int s_{1},s_{2}, s_{3} ;
      |                   ^~
a.cc:5:13: note: 'int s_' previously declared here
    5 |         int s_{1},s_{2}, s_{3} ;
      |             ^~
a.cc:5:26: error: redeclaration of 'int s_'
    5 |         int s_{1},s_{2}, s_{3} ;
      |                          ^~
a.cc:5:13: note: 'int s_' previously declared here
    5 |         int s_{1},s_{2}, s_{3} ;
      |             ^~
a.cc:7:18: error: expected ';' before '{' token
    7 |         cin >> s_{1}>> s_{2} >> s_{3};
      |                  ^
      |                  ;
a.cc:7:21: error: expected primary-expression before '>>' token
    7 |         cin >> s_{1}>> s_{2} >> s_{3};
      |                     ^~
a.cc:7:30: error: expected primary-expression before '>>' token
    7 |         cin >> s_{1}>> s_{2} >> s_{3};
      |                              ^~
a.cc:8:15: error: expected ';' before '{' token
    8 |       cout<<s_{1} + s_{2} + s_{3} <<endl;
      |               ^
      |               ;
a.cc:8:23: error: expected ';' before '{' token
    8 |       cout<<s_{1} + s_{2} + s_{3} <<endl;
      |                       ^
      |                       ;
a.cc:8:31: error: expected ';' before '{' token
    8 |       cout<<s_{1} + s_{2} + s_{3} <<endl;
      |                               ^
      |                               ;
a.cc:8:35: error: expected primary-expression before '<<' token
    8 |       cout<<s_{1} + s_{2} + s_{3} <<endl;
      |                                   ^~
Language: C++

#include <bits/stdc++.h>
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;
  }


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

#include <bits/stdc++.h>
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;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     if(S[i] == "1"){
a.cc:13:4: error: expected '}' at end of input
   13 |   }
      |    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <unordered_set>
#include <unordered_map>
#include <sstream>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <numeric>
#include <iterator>
using namespace std;

namespace {

}

int Work1()
{
	string s, s1, s2, s3;

	cin >> s;

	int count1 = 0;
	for (int i = 0; i < 3; i++){
		if (s[i] == '1'){
			++count1;
		}
	}

	cout << count1;

	return 0;
}


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

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

int main() {
  string s;
  cin >> s;
  int ans=0;
  for ( char c:s ) {
    if ( c=='1' ) ans++;
  }
  cout << ans << '\n';
  return 0; 
}

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
 int a = s.at(0);
 int b = s.at(1);
 int c = s.at(2);
  
  cin >> a >> b >> c;
  cout << a + b + c << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: 's' was not declared in this scope
    5 |  int a = s.at(0);
      |          ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: 's' was not declared in this scope
    5 |  int a = s[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:6: note: previous declaration as 'int s [1]'
    5 |  int s[1] , s[2] , s[3];
      |      ^
a.cc:5:20: error: conflicting declaration 'int s [3]'
    5 |  int s[1] , s[2] , s[3];
      |                    ^
a.cc:5:6: note: previous declaration as 'int s [1]'
    5 |  int s[1] , s[2] , s[3];
      |      ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: invalid types 'int[int]' for array subscript
    7 |   cin >> s[1] >> s[2] >> s[3];
      |           ^
a.cc:7:19: error: invalid types 'int[int]' for array subscript
    7 |   cin >> s[1] >> s[2] >> s[3];
      |                   ^
a.cc:7:27: error: invalid types 'int[int]' for array subscript
    7 |   cin >> s[1] >> s[2] >> s[3];
      |                           ^
a.cc:8:12: error: invalid types 'int[int]' for array subscript
    8 |   cout << s[1] + s[2] + s[3] << endl;
      |            ^
a.cc:8:19: error: invalid types 'int[int]' for array subscript
    8 |   cout << s[1] + s[2] + s[3] << endl;
      |                   ^
a.cc:8:26: error: invalid types 'int[int]' for array subscript
    8 |   cout << s[1] + s[2] + s[3] << endl;
      |                          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
 int a , b , c;
  
  cin >> abc;
  cout << a + b + c << endl;
}


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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:5:13: error: conflicting declaration 'int s [2]'
    5 |  int s[1] , s[2] , s[3];
      |             ^
a.cc:5:6: note: previous declaration as 'int s [1]'
    5 |  int s[1] , s[2] , s[3];
      |      ^
a.cc:5:20: error: conflicting declaration 'int s [3]'
    5 |  int s[1] , s[2] , s[3];
      |                    ^
a.cc:5:6: note: previous declaration as 'int s [1]'
    5 |  int s[1] , s[2] , s[3];
      |      ^
a.cc:7:14: error: expected ';' before 's'
    7 |   cin >> s[1] s[2] s[3];
      |              ^~
      |              ;
Language: C++

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


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

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


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

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

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

#include<bits/stdc++.h>
using namespace std;
 
int main(){
  int s,i,ans=0;
  int[] a;
  cin >> s;
  a[0] = s/100;
  a[1] = (s - 100*a)/10;
  a[2] = s%10;
  for(i = 0;i<3;i++){
    if(a[i]==1)ans++;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: structured binding declaration cannot have type 'int'
    6 |   int[] a;
      |      ^~
a.cc:6:6: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:6:6: error: empty structured binding declaration
a.cc:6:9: error: expected initializer before 'a'
    6 |   int[] a;
      |         ^
a.cc:8:3: error: 'a' was not declared in this scope
    8 |   a[0] = s/100;
      |   ^
Language: C++

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

int main(){
  int s,i,ans=0;
  int[] a;
  cin >> s;
  a[0] = s/100;
  a[1] = (s - 100*a)/10;
  a[2] = s%10;
  for(i = 0;i<3;i++){
    if(a[i]==1)ans++;
  }
  cout << ans << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: structured binding declaration cannot have type 'int'
    6 |   int[] a;
      |      ^~
a.cc:6:6: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:6:6: error: empty structured binding declaration
a.cc:6:9: error: expected initializer before 'a'
    6 |   int[] a;
      |         ^
a.cc:8:3: error: 'a' was not declared in this scope
    8 |   a[0] = s/100;
      |   ^
a.cc:14:23: error: expected '}' at end of input
   14 |   cout << ans << endl;
      |                       ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

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

int main() {
  char[] a;
  cin >> a;
  int x = 0;
  for(i = 0; i < 3; i++) {
    x = int(a[i]);
  }
  cout << x << endl;
}


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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: expected ',' or ';' before 'cout'
   12 |   cout << s1 + s2 + s3 << endl;
      |   ^~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected ',' or ';' before 'cout'
   10 |   cout << s2 + s3 + s1 << endl;
      |   ^~~~
Language: C++

        #include <bits/stdc++.h>
        using namespace std;
         
        int main() {
          string s1,s2,s3;
          int i,cnt = 0;
          cin >> s1 >> s2 >> s3;
          char box[3] = {s1, s2, s3};
          for (i = 0; i<=2; i++) {
          	if(box[i] == '1'){
              cnt++;
            }
          }
          cout << cnt  << endl;
        }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:26: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char' in initialization
    8 |           char box[3] = {s1, s2, s3};
      |                          ^~
      |                          |
      |                          std::string {aka std::__cxx11::basic_string<char>}
a.cc:8:30: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char' in initialization
    8 |           char box[3] = {s1, s2, s3};
      |                              ^~
      |                              |
      |                              std::string {aka std::__cxx11::basic_string<char>}
a.cc:8:34: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char' in initialization
    8 |           char box[3] = {s1, s2, s3};
      |                                  ^~
      |                                  |
      |                                  std::string {aka std::__cxx11::basic_string<char>}
Language: C++

        #include <bits/stdc++.h>
        using namespace std;
         
        int main() {
          int s1,s2,s3;
          int i,cnt = 0;
          cin >> s1 >> s2 >> s3;
          int box[3] = {s1, s2, s3}
          for (i = 0; i<=3; i++;){
          	if(box[i] == '1'){
              cnt++;
            }
          }
          cout << cnt  << endl;
        }

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: expected ',' or ';' before 'for'
    9 |           for (i = 0; i<=3; i++;){
      |           ^~~
a.cc:9:33: error: expected primary-expression before ')' token
    9 |           for (i = 0; i<=3; i++;){
      |                                 ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: 'box' was not declared in this scope
    8 |           box[3] = {s1, s2, s3}
      |           ^~~
a.cc:9:32: error: expected ';' before ')' token
    9 |           for (i = 0; i<=3; i++){
      |                                ^
      |                                ;
Language: C++

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

int main(){
  int s1,s2,s3,n;
  cin >> s1 >> s2 >> s3;
  for (int i=1;i<=3;i++){
    if(s(i)==1){
      n+=1
    }
  }
  cout << n << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 's' was not declared in this scope
    8 |     if(s(i)==1){
      |        ^
a.cc:9:11: error: expected ';' before '}' token
    9 |       n+=1
      |           ^
      |           ;
   10 |     }
      |     ~
Language: C++

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

int main(){
  int s1,s2,s3,n;
  cin >> s1 >> s2 >> s3;
  for (int i=1;i<=3;i++){
    if(si==1){
      n+=1
    }
  }
  cout << n << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'si' was not declared in this scope; did you mean 'i'?
    8 |     if(si==1){
      |        ^~
      |        i
a.cc:9:11: error: expected ';' before '}' token
    9 |       n+=1
      |           ^
      |           ;
   10 |     }
      |     ~
Language: C++

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

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

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

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

  cin >> a,
  cin >> b,
  cin >> c

   
 cout <<  ( a + b + c ) << endl;
}


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
    7 |   cout << int(s1) + int(s2) + int(s3) << endl;
      |           ^~~~~~~
a.cc:7:21: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
    7 |   cout << int(s1) + int(s2) + int(s3) << endl;
      |                     ^~~~~~~
a.cc:7:31: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
    7 |   cout << int(s1) + int(s2) + int(s3) << endl;
      |                               ^~~~~~~
Language: C++

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

int main(){
String s;  
int t = 0;
cin >> s;

if(s[0] == 1){
  t++;
	}
if(s[1] == 1){
	t++;
	}
if(s[2] == 1){
	t++;
	}
cout << t << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:1: error: 'String' was not declared in this scope
    6 | String s;
      | ^~~~~~
a.cc:8:8: error: 's' was not declared in this scope
    8 | cin >> s;
      |        ^
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:14: error: redeclaration of 'int s_'
    5 |   int s_{1}, s_{2}, s_{3};
      |              ^~
a.cc:5:7: note: 'int s_' previously declared here
    5 |   int s_{1}, s_{2}, s_{3};
      |       ^~
a.cc:5:21: error: redeclaration of 'int s_'
    5 |   int s_{1}, s_{2}, s_{3};
      |                     ^~
a.cc:5:7: note: 'int s_' previously declared here
    5 |   int s_{1}, s_{2}, s_{3};
      |       ^~
a.cc:6:12: error: expected ';' before '{' token
    6 |   cin >> s_{1} >> s_{2} >> s_{3};
      |            ^
      |            ;
a.cc:6:16: error: expected primary-expression before '>>' token
    6 |   cin >> s_{1} >> s_{2} >> s_{3};
      |                ^~
a.cc:6:25: error: expected primary-expression before '>>' token
    6 |   cin >> s_{1} >> s_{2} >> s_{3};
      |                         ^~
a.cc:7:13: error: expected ';' before '{' token
    7 |   cout << s_{1}+s_{2}+s_{3} << endl;
      |             ^
      |             ;
a.cc:7:19: error: expected ';' before '{' token
    7 |   cout << s_{1}+s_{2}+s_{3} << endl;
      |                   ^
      |                   ;
a.cc:7:25: error: expected ';' before '{' token
    7 |   cout << s_{1}+s_{2}+s_{3} << endl;
      |                         ^
      |                         ;
a.cc:7:29: error: expected primary-expression before '<<' token
    7 |   cout << s_{1}+s_{2}+s_{3} << endl;
      |                             ^~
Language: C++

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

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

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

public class Main{
  // TODO 自動生成されたメソッド・スタブ
    public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int i = scan.nextInt();
    String s = String.valueOf(i);
    String[] ss = s.split("");
    int count = 0;
    for(String masu : ss){
      if(masu.equals("1")) {
        count = count + 1;
      }
    }
    System.out.println(count);
    }
}

Compiler output:
Main.java:4: error: cannot find symbol
    Scanner scan = new Scanner(System.in);
    ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
    Scanner scan = new Scanner(System.in);
                       ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

public class Main(String[] args) {
  // TODO 自動生成されたメソッド・スタブ
    public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int i = scan.nextInt();
    String s = String.valueOf(i);
    String[] ss = s.split("");
    int count = 0;
    for(String masu : ss){
      if(masu.equals("1")) {
        count = count + 1;
      }
    }
    System.out.println(count);
    }
}

Compiler output:
Main.java:1: error: '{' expected
public class Main(String[] args) {
                 ^
1 error
Language: Java

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int i = scan.nextInt();
		String s = String.valueOf(i);
		String[] ss = s.split("");
		int count = 0;
		for(String masu : ss){
			if(masu.equals("1")) {
				count = 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 b, a;
  cin >> b >> a >> c;
  cout << a + b + c << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:20: error: 'c' was not declared in this scope
    6 |   cin >> b >> a >> c;
      |                    ^
Language: Java

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

      int sum = 0;
      for(String i: a){
        sum += Integer.parseInt(i);
      }
      System.out.println(sum);
      sc.close();
    }
    
}

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

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

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

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

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int s1s2s3,c;
  cin>>s1>s2s3;
  c=s1s2s3%3;
  
  cout<<c<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:8: error: 's1' was not declared in this scope; did you mean 'y1'?
    6 |   cin>>s1>s2s3;
      |        ^~
      |        y1
a.cc:6:11: error: 's2s3' was not declared in this scope; did you mean 's1s2s3'?
    6 |   cin>>s1>s2s3;
      |           ^~~~
      |           s1s2s3
Language: Java

import java.uitl.*;

public class Main {
  public static void main (String args[]) {
    Scanner sc = new Scanner(System.in);
    
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    
    System.out.println(a+b+c);
  }
}

Compiler output:
Main.java:1: error: package java.uitl does not exist
import java.uitl.*;
^
Main.java:5: error: cannot find symbol
    Scanner sc = new Scanner(System.in);
    ^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
    Scanner sc = new Scanner(System.in);
                     ^
  symbol:   class Scanner
  location: class Main
3 errors
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:26: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    7 |   cout << (s1 + s2 + s3  << endl;
      |            ~~~~~~~~~~~~~~^~~~~~~
a.cc:7:33: error: expected ')' before ';' token
    7 |   cout << (s1 + s2 + s3  << endl;
      |           ~                     ^
      |                                 )
Language: C++

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

int main() {
  // ここにプログラムを追記
  int A;
  int B;
  int C
  cin>>A>>B>>C;
  cout<<A+B+C<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected initializer before 'cin'
    9 |   cin>>A>>B>>C;
      |   ^~~
a.cc:10:13: error: 'C' was not declared in this scope
   10 |   cout<<A+B+C<<endl;
      |             ^
Language: Java

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


Compiler output:
Main.java:9: error: cannot find symbol
    for(int i=0; i<a.length(); i++){
                   ^
  symbol:   variable a
  location: class Main
Main.java:10: error: cannot find symbol
      if(a.charAt(i) == '1'){
         ^
  symbol:   variable a
  location: class Main
2 errors
Language: C++

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

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

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

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

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

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

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

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #indlude; did you mean #include?
    1 | #indlude <bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> s1 >> s2 >> s3;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #indlude <bits/stdc++.h>
a.cc:6:3: error: 'cout' was not declared in this scope
    6 |   cout << s1+ s2 +s3 << endl;
      |   ^~~~
a.cc:6:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:6:25: error: 'endl' was not declared in this scope
    6 |   cout << s1+ s2 +s3 << endl;
      |                         ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #indlude <bits/stdc++.h>
Language: C++

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

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



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

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: expected primary-expression before ';' token
   11 |   cout << x <<;
      |               ^
Language: Java

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:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String n = nextLine();
        int count;
      	for(int i = 0; i < n.length; i++){
        	if(n[i] == "1") count++;
        }
      	System.out.println(count);
    }
}

Compiler output:
Main.java:6: error: cannot find symbol
        String n = nextLine();
                   ^
  symbol:   method nextLine()
  location: class Main
Main.java:8: error: cannot find symbol
      	for(int i = 0; i < n.length; i++){
      	                    ^
  symbol:   variable length
  location: variable n of type String
Main.java:9: error: array required, but String found
        	if(n[i] == "1") count++;
        	    ^
3 errors
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: expected ';' before 'c'
    8 |   a = N/100
      |            ^
      |            ;
    9 |   c = N%10
      |   ~
Language: C++

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

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

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

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

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

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:14:15: error: passing argument 1 of 'atoi' makes pointer from integer without a cast [-Wint-conversion]
   14 |     if (atoi(s[i]) == 1)
      |              ~^~~
      |               |
      |               char
In file included from main.c:2:
/usr/include/stdlib.h:105:30: note: expected 'const char *' but argument is of type 'char'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
main.c:20:22: error: expected ';' before 'return'
   20 |   printf("%d",answer)
      |                      ^
      |                      ;
   21 | 
   22 |   return 0;
      |   ~~~~~~
Language: C++

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

int main() {
  int n;
  cin >> n;
  int sum;
  int m = 100000000
  for (int i = 0; i < n; i++) {
    sum = 0
    int a;
    cin >> a;
    
    for (int j = 0; ; j++) {
      if (a % 2 == 0)
        a /= 2;
      else {
        sum = j;
        break;
      }
    }
    if (sum < m)
      m = sum;
  }
    cout << m << endl;
}

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

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


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: 'i' was not declared in this scope
    6 |   for(i=0, i<3, i++){
      |       ^
a.cc:12:1: error: expected primary-expression before '}' token
   12 | }
      | ^
a.cc:11:24: error: expected ')' before '}' token
   11 |   cout << count <<endl;
      |                        ^
      |                        )
   12 | }
      | ~                       
a.cc:6:6: note: to match this '('
    6 |   for(i=0, i<3, i++){
      |      ^
a.cc:12:1: error: expected primary-expression before '}' token
   12 | }
      | ^
Language: C++

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

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

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

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

Compiler output:
Main.java:10: error: ')' expected
    	    if(s[i].equals("1") ans++;
    	                       ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int S1, S2, S3;
  cin >> S1 >> s2 >> s3;
  cout << S1+S2+S3 <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: 's2' was not declared in this scope; did you mean 'S2'?
    6 |   cin >> S1 >> s2 >> s3;
      |                ^~
      |                S2
a.cc:6:22: error: 's3' was not declared in this scope; did you mean 'S3'?
    6 |   cin >> S1 >> s2 >> s3;
      |                      ^~
      |                      S3
Language: C++

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

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

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

#include <iostream>
#include <string>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string s;
      |   ^~~~~~
a.cc:6: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:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   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:7:10: error: 's' was not declared in this scope
    7 |   cin >> s;
      |          ^
a.cc:11:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |   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:11:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 |   cout << i << 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 <bits/stdc++.h>
using namespace std;

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

}



Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
    8 |   int main() {
      |           ^~
a.cc:8:11: note: remove parentheses to default-initialize a variable
    8 |   int main() {
      |           ^~
      |           --
a.cc:8:11: note: or replace parentheses with braces to value-initialize a variable
a.cc:8:14: error: a function-definition is not allowed here before '{' token
    8 |   int main() {
      |              ^
Language: C++

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

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

  int count = 0;
  for (int i = 0; i < int.size(); i++) {
    if (int.at(i) == '1') {
      count++;
    }
  }

  cout << count << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:23: error: expected primary-expression before 'int'
    9 |   for (int i = 0; i < int.size(); i++) {
      |                       ^~~
a.cc:9:22: error: expected ';' before 'int'
    9 |   for (int i = 0; i < int.size(); i++) {
      |                      ^~~~
      |                      ;
a.cc:9:23: error: expected primary-expression before 'int'
    9 |   for (int i = 0; i < int.size(); i++) {
      |                       ^~~
a.cc:9:22: error: expected ')' before 'int'
    9 |   for (int i = 0; i < int.size(); i++) {
      |       ~              ^~~~
      |                      )
a.cc:9:26: error: expected unqualified-id before '.' token
    9 |   for (int i = 0; i < int.size(); i++) {
      |                          ^
a.cc:9:35: error: 'i' was not declared in this scope
    9 |   for (int i = 0; i < int.size(); i++) {
      |                                   ^
Language: C++

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

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

  int count = 0;
  for (int i = 0; i < a.size(); i++) {
    if (a.at(i) == '1') {
      count++;
    }
  }

  cout << count << endl;
}



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