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

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
const int MOD=(int)1e9+7;
using namespace std;
int main(){
    string a,b,c;
    cin>>a>>b>>c;
    cout<<char[0]+char[1]+char[2]endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected primary-expression before 'char'
    8 |     cout<<char[0]+char[1]+char[2]endl;
      |           ^~~~
Language: C++

#include <iostream>
#include <map>

using namespace std;

int main(void){
    string s;
    map<char,int> dict;

    cin >> s;

    for (int i=0;i<s.length;i++){
        dict[s[i]]++;
    }   
    cout << dict['1'];   
}

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

#include <iostream>
#include <map>

using namespace std;

int main(void){
    string s;
    map<char,int> dict;

    cin >> s;

    for (auto i=s.begin();i<s.end();i++){
        dict[s[i]++;
    }   
    cout << dict['1'];   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: no match for 'operator[]' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >')
   13 |         dict[s[i]++;
      |               ^
In file included from /usr/include/c++/14/string:54,
                 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,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1247:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::const_reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; const_reference = const char&; size_type = long unsigned int]'
 1247 |       operator[] (size_type __pos) const _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:1247:29: note:   no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
 1247 |       operator[] (size_type __pos) const _GLIBCXX_NOEXCEPT
      |                   ~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:1265:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; reference = char&; size_type = long unsigned int]'
 1265 |       operator[](size_type __pos)
      |       ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:1265:28: note:   no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
 1265 |       operator[](size_type __pos)
      |                  ~~~~~~~~~~^~~~~
a.cc:13:20: error: expected ']' before ';' token
   13 |         dict[s[i]++;
      |                    ^
      |                    ]
Language: C++

#include <iostream>
#include <map>

using namespace std;

int main(void){
    string s;
    map<char,int> dict;

    cin >> s;

    for (auto i=s.begin();i<s.end();i++){
        dict[i]++;
    }   
    cout << dict['1'];   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: no match for 'operator[]' (operand types are 'std::map<char, int>' and '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >')
   13 |         dict[i]++;
      |             ^
In file included from /usr/include/c++/14/map:63,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = char]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' to 'const std::map<char, int>::key_type&' {aka 'const char&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = char]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' to 'std::map<char, int>::key_type&&' {aka 'char&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
Language: C++

#include <iostream>
#include <map>

using namespace std;

int main(void){
    string s;
    map<char,int> dict;

    cin >> s;

    for (iterator i=s.begin();i<s.end();i++){
        dict[s[i]]++;
    }   
    cout << dict['1'];   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:29: error: class template argument deduction failed:
   12 |     for (iterator i=s.begin();i<s.end();i++){
      |                             ^
a.cc:12:29: error: no matching function for call to 'iterator(std::__cxx11::basic_string<char>::iterator)'
In file included from /usr/include/c++/14/bits/stl_iterator_base_funcs.h:66,
                 from /usr/include/c++/14/string:47,
                 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,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator_base_types.h:127:34: note: candidate: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> iterator()-> std::iterator<_Category, _Tp, _Distance, _Pointer, _Reference>'
  127 |     struct _GLIBCXX17_DEPRECATED iterator
      |                                  ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:127:34: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/stl_iterator_base_types.h:127:34: note: candidate: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> iterator(std::iterator<_Category, _Tp, _Distance, _Pointer, _Reference>)-> std::iterator<_Category, _Tp, _Distance, _Pointer, _Reference>'
/usr/include/c++/14/bits/stl_iterator_base_types.h:127:34: note:   template argument deduction/substitution failed:
a.cc:12:29: note:   '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' is not derived from 'std::iterator<_Category, _Tp, _Distance, _Pointer, _Reference>'
   12 |     for (iterator i=s.begin();i<s.end();i++){
      |                             ^
Language: C++

#include <iostream>
#include <map>

using namespace std;

int main(void){
    string s;
    map<char,int> dict;

    cin >> s;

    for (iterator i=s.begin();i<s.end().;i++){
        dict[s[i]]++;
    }   
    cout << dict['1'];   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:29: error: class template argument deduction failed:
   12 |     for (iterator i=s.begin();i<s.end().;i++){
      |                             ^
a.cc:12:29: error: no matching function for call to 'iterator(std::__cxx11::basic_string<char>::iterator)'
In file included from /usr/include/c++/14/bits/stl_iterator_base_funcs.h:66,
                 from /usr/include/c++/14/string:47,
                 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,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator_base_types.h:127:34: note: candidate: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> iterator()-> std::iterator<_Category, _Tp, _Distance, _Pointer, _Reference>'
  127 |     struct _GLIBCXX17_DEPRECATED iterator
      |                                  ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:127:34: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/stl_iterator_base_types.h:127:34: note: candidate: 'template<class _Category, class _Tp, class _Distance, class _Pointer, class _Reference> iterator(std::iterator<_Category, _Tp, _Distance, _Pointer, _Reference>)-> std::iterator<_Category, _Tp, _Distance, _Pointer, _Reference>'
/usr/include/c++/14/bits/stl_iterator_base_types.h:127:34: note:   template argument deduction/substitution failed:
a.cc:12:29: note:   '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' is not derived from 'std::iterator<_Category, _Tp, _Distance, _Pointer, _Reference>'
   12 |     for (iterator i=s.begin();i<s.end().;i++){
      |                             ^
a.cc:12:41: error: expected unqualified-id before ';' token
   12 |     for (iterator i=s.begin();i<s.end().;i++){
      |                                         ^
Language: C++

#include <iostream>
#include <map>

using namespace std;

int main(void){
    string s;
    map<char,int> dict;

    cin >> s;

    for (int i=0;i<s.size;i++){
        dict[s[i]]++;
    }   
    cout << dict['1'];   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: 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 '()' ?)
   12 |     for (int i=0;i<s.size;i++){
      |                    ~~^~~~
      |                          ()
Language: C++

#include <iostream>
#include <map>

using namespace std;

int main(void){
    string s;
    map<char,int> dict;

    cin >> s;

    for (int i=0;i<s.size;i++){}
        dict[s[i]]++;
    }   
    cout << dict['1'];   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: 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 '()' ?)
   12 |     for (int i=0;i<s.size;i++){}
      |                    ~~^~~~
      |                          ()
a.cc:13:16: error: 'i' was not declared in this scope
   13 |         dict[s[i]]++;
      |                ^
a.cc: At global scope:
a.cc:15:5: error: 'cout' does not name a type
   15 |     cout << dict['1'];
      |     ^~~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C++

#include <iostream>
#include <map>

using namespace std;

int main(void){
    string s;
    map<char,int> dict;

    cin >> s;

    for (char c : s){
        dict[s]++;
    }   
    cout << dict['1'];   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: no match for 'operator[]' (operand types are 'std::map<char, int>' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   13 |         dict[s]++;
      |             ^
In file included from /usr/include/c++/14/map:63,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = char]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const std::map<char, int>::key_type&' {aka 'const char&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = char; _Tp = int; _Compare = std::less<char>; _Alloc = std::allocator<std::pair<const char, int> >; mapped_type = int; key_type = char]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::map<char, int>::key_type&&' {aka 'char&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
Language: C++


#include <cstdio>

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

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: 's' was not declared in this scope
    8 |         scanf("%d",&s[i]);
      |                     ^
Language: C++

#include <iostream>

using namespace std;

int main()
{
  	array<int, 3> S;
  	for(int i = 0; i < 3; i++){
		cin >> S.at(i);
    }
  	int a = 0;
  	for(int i = 0; i < 3; i++){
      if(S.at(i) == 1){
        a++;
      }
    }
  	cout << a;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: aggregate 'std::array<int, 3> S' has incomplete type and cannot be defined
    7 |         array<int, 3> S;
      |                       ^
a.cc:2:1: note: 'std::array' is defined in header '<array>'; this is probably fixable by adding '#include <array>'
    1 | #include <iostream>
  +++ |+#include <array>
    2 |
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.at(i) == "1"){
      count++;
    }
  }
    
  cout << count << endl;
  return 0;
}

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

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

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: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 | using namespace std;
Language: C++

using namespace std;
 
int main(){
  string s;
  cin >> s;
  int count = 0;
  
  for(int i = 0; i < 3; i++){
    if(s.at(i) == '1'){
      count++;
    }
  }
  cout << count << endl;
  return 0;
}

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:13:3: error: 'cout' was not declared in this scope
   13 |   cout << count << endl;
      |   ^~~~
a.cc:13:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:20: error: 'endl' was not declared in this scope
   13 |   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 | using namespace std;
Language: Java


import java.util.Scanner;

public class Mazin {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String a = in.next();
		int count=0;
		for(int i=0;i<a.length();i++) {
			char charAt = a.charAt(i);
			if(charAt=='1') {
				count++;
			}
		}
		System.out.println(count);
	}
}

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

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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:18:13: error: expected ';' before '{' token
   18 |   else(a==0){
      |             ^
      |             ;
a.cc:29:4: error: expected '}' at end of input
   29 |   }
      |    ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
	string s;
	cin>>s;
	int ans =0;
	if (s[0]=='1')
	{
		ans++;
	}
	if (s[1]=='1')
	{
		ans++
	}
	if (s[2]=='1')
	{
		ans++;
	}
	printf("%d",ans );
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:14:22: error: expected ';' before '}' token
   14 |                 ans++
      |                      ^
      |                      ;
   15 |         }
      |         ~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: could not convert 'a.std::__cxx11::basic_string<char>::operator=(49)' from 'std::__cxx11::basic_string<char>' to 'bool'
    7 |   if(a='1'){d=d+1;}else{d=d;}
      |      ~^~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:8:7: error: could not convert 'b.std::__cxx11::basic_string<char>::operator=(49)' from 'std::__cxx11::basic_string<char>' to 'bool'
    8 |   if(b='1'){d=d+1;}else{d=d;}
      |      ~^~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:9:7: error: could not convert 'c.std::__cxx11::basic_string<char>::operator=(49)' from 'std::__cxx11::basic_string<char>' to 'bool'
    9 |   if(c='1'){d=d+1;}else{d=d;}
      |      ~^~~~
      |       |
      |       std::__cxx11::basic_string<char>
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'chara' was not declared in this scope; did you mean 'char'?
    4 |   chara,b,c;
      |   ^~~~~
      |   char
a.cc:4:9: error: 'b' was not declared in this scope
    4 |   chara,b,c;
      |         ^
a.cc:4:11: error: 'c' was not declared in this scope
    4 |   chara,b,c;
      |           ^
a.cc:5:10: error: 'a' was not declared in this scope
    5 |   cin >> a >> b >> c;
      |          ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'chara' was not declared in this scope; did you mean 'char'?
    4 |   chara,b,c;
      |   ^~~~~
      |   char
a.cc:4:9: error: 'b' was not declared in this scope
    4 |   chara,b,c;
      |         ^
a.cc:4:11: error: 'c' was not declared in this scope
    4 |   chara,b,c;
      |           ^
a.cc:5:10: error: 'a' was not declared in this scope
    5 |   cin >> a >> b >> c;
      |          ^
a.cc:7:18: error: expected ';' before '}' token
    7 |   if(a='1'){d=d+1}else{d=d};
      |                  ^
      |                  ;
a.cc:7:27: error: expected ';' before '}' token
    7 |   if(a='1'){d=d+1}else{d=d};
      |                           ^
      |                           ;
a.cc:8:18: error: expected ';' before '}' token
    8 |   if(b='1'){d=d+1}else{d=d};
      |                  ^
      |                  ;
a.cc:8:27: error: expected ';' before '}' token
    8 |   if(b='1'){d=d+1}else{d=d};
      |                           ^
      |                           ;
a.cc:9:18: error: expected ';' before '}' token
    9 |   if(c='1'){d=d+1}else{d=d};
      |                  ^
      |                  ;
a.cc:9:27: error: expected ';' before '}' token
    9 |   if(c='1'){d=d+1}else{d=d};
      |                           ^
      |                           ;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: could not convert 'a.std::__cxx11::basic_string<char>::operator=(49)' from 'std::__cxx11::basic_string<char>' to 'bool'
    7 |   if(a='1'){d=d+1}else{d=d};
      |      ~^~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:7:18: error: expected ';' before '}' token
    7 |   if(a='1'){d=d+1}else{d=d};
      |                  ^
      |                  ;
a.cc:7:27: error: expected ';' before '}' token
    7 |   if(a='1'){d=d+1}else{d=d};
      |                           ^
      |                           ;
a.cc:8:7: error: could not convert 'b.std::__cxx11::basic_string<char>::operator=(49)' from 'std::__cxx11::basic_string<char>' to 'bool'
    8 |   if(b='1'){d=d+1}else{d=d};
      |      ~^~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:8:18: error: expected ';' before '}' token
    8 |   if(b='1'){d=d+1}else{d=d};
      |                  ^
      |                  ;
a.cc:8:27: error: expected ';' before '}' token
    8 |   if(b='1'){d=d+1}else{d=d};
      |                           ^
      |                           ;
a.cc:9:7: error: could not convert 'c.std::__cxx11::basic_string<char>::operator=(49)' from 'std::__cxx11::basic_string<char>' to 'bool'
    9 |   if(c='1'){d=d+1}else{d=d};
      |      ~^~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:9:18: error: expected ';' before '}' token
    9 |   if(c='1'){d=d+1}else{d=d};
      |                  ^
      |                  ;
a.cc:9:27: error: expected ';' before '}' token
    9 |   if(c='1'){d=d+1}else{d=d};
      |                           ^
      |                           ;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: could not convert 'a.std::__cxx11::basic_string<char>::operator=(49)' from 'std::__cxx11::basic_string<char>' to 'bool'
    7 |   if(a='1'){d=d+1};
      |      ~^~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:7:18: error: expected ';' before '}' token
    7 |   if(a='1'){d=d+1};
      |                  ^
      |                  ;
a.cc:8:7: error: could not convert 'b.std::__cxx11::basic_string<char>::operator=(49)' from 'std::__cxx11::basic_string<char>' to 'bool'
    8 |   if(b='1'){d=d+1};
      |      ~^~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:8:18: error: expected ';' before '}' token
    8 |   if(b='1'){d=d+1};
      |                  ^
      |                  ;
a.cc:9:7: error: could not convert 'c.std::__cxx11::basic_string<char>::operator=(49)' from 'std::__cxx11::basic_string<char>' to 'bool'
    9 |   if(c='1'){d=d+1};
      |      ~^~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:9:18: error: expected ';' before '}' token
    9 |   if(c='1'){d=d+1};
      |                  ^
      |                  ;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: could not convert 'a.std::__cxx11::basic_string<char>::operator=(49)' from 'std::__cxx11::basic_string<char>' to 'bool'
    7 |   if(a='1'){d=d+1}
      |      ~^~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:7:18: error: expected ';' before '}' token
    7 |   if(a='1'){d=d+1}
      |                  ^
      |                  ;
a.cc:8:7: error: could not convert 'b.std::__cxx11::basic_string<char>::operator=(49)' from 'std::__cxx11::basic_string<char>' to 'bool'
    8 |   if(b='1'){d=d+1}
      |      ~^~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:8:18: error: expected ';' before '}' token
    8 |   if(b='1'){d=d+1}
      |                  ^
      |                  ;
a.cc:9:7: error: could not convert 'c.std::__cxx11::basic_string<char>::operator=(49)' from 'std::__cxx11::basic_string<char>' to 'bool'
    9 |   if(c='1'){d=d+1}
      |      ~^~~~
      |       |
      |       std::__cxx11::basic_string<char>
a.cc:9:18: error: expected ';' before '}' token
    9 |   if(c='1'){d=d+1}
      |                  ^
      |                  ;
Language: C++

#include<stdio.h>
int main(void)
{
	int a;
	scanf("%d",&a);
	
	if(a==0){
		printf("0\n");
	}
	else if(a==100){
		printf("1\n");
	}
	else if(a==10){
		printf("1\n");
	}
	else if(a==1){
		printf("1\n");
	}
	else if(a==110){
		printf("2\n");
	}
	else if(a==11){
		printf("2\n");+
	}
	else if(a==101){
		printf("2\n");
	}
	else if(a==111){
		printf("3\n");
	}
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: expected primary-expression before '}' token
   24 |         }
      |         ^
Language: C

#include<stdio.h>
int main(void)
{
	int s1,s2,s3,x,y,z,sum;
	scanf("%d %d %d",&s1,&s2,&s3);
	sum=0;
	x=s1/1;
	y=s2/1;
	z=s3/1;
	if(x==1){
		sum=sum+1;
	}
	if(y==1){
		sum=sum+1;
	}
	if(z==1){
		sum=sum+1;
	}
	printf("%d\n",sum);
	retunr 0;
}
	

Compiler output:
main.c: In function 'main':
main.c:20:9: error: 'retunr' undeclared (first use in this function)
   20 |         retunr 0;
      |         ^~~~~~
main.c:20:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:15: error: expected ';' before numeric constant
   20 |         retunr 0;
      |               ^~
      |               ;
Language: C++

#include<stdio.h>
int main(void)
{
	int s1,s2,s3,x,y,z,sum;
	scanf("%d %d %d",&s1,&s2,&s3);
	sum=0;
	x=s1/1;
	y=s2/1;
	z=s3/1;
	if(x==1){
		sum=sum+1;
	}
	if(y==1){
		sum=sum+1;
	}
	if(z==1){
		sum=sum+1;
	}
	printf("%d\n",sum);
	retunr 0;
}
	

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'retunr' was not declared in this scope
   20 |         retunr 0;
      |         ^~~~~~
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++

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

Compiler output:
a.cc:2:1: error: 'string' does not name a type
    2 | string s;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     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; int ans;
a.cc:4:12: error: 's' was not declared in this scope
    4 |     cin >> s;
      |            ^
a.cc:8:5: error: 'cout' was not declared in this scope
    8 |     cout << ans << endl;
      |     ^~~~
a.cc:8:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:8:20: error: 'endl' was not declared in this scope
    8 |     cout << ans << 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; int ans;
Language: C

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

int main() {
    int n, cnt = 0;
    int flag = 0;
    cin >> n;
    int a[n];
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    while(true){
        for(int i = 0; i < n ; i++) {
            if(a[i] % 2 != 0)flag=1;
            a[i] = a[i] / 2;
        }
        if(flag==1)break;
        cnt++;
    }
    cout << cnt << endl;
}


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

#include <iostream>
#include <string>

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

Compiler output:
a.cc: In function 'int main()':
a.cc: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 << ans << endl;}
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:11:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 |   cout << ans << endl;}
      |                  ^~~~
      |                  std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: Java

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

Compiler output:
Main.java:10: error: variable ans might not have been initialized
				ans++;
				^
Main.java:14: error: variable ans might not have been initialized
       	System.out.println(ans);
       	                   ^
2 errors
Language: Java

import java.util.Scanner;

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

Compiler output:
Main.java:3: error: '{' expected
public class Main(){
                 ^
1 error
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:40: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |   for (int i = 0; i < 3; i++) if (s[i] == "1") count++;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:40: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |   for (int i = 0; i < 3; i++) if (s[i] == "1") count++;
Language: C++

#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:1024000000,1024000000")
#define mem(a,b) memset((a),(b),sizeof(a))
#define MP make_pair
#define pb push_back
#define fi first
#define se second
#define sz(x) (int)x.size()
#define all(x) x.begin(),x.end()
#define _GLIBCXX_PERMIT_BACKWARD_HASH
#include <ext/hash_map>
using namespace __gnu_cxx;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
typedef vector<int> VI;
typedef vector<ll> VL;
struct str_hash{size_t operator()(const string& str)const{return __stl_hash_string(str.c_str());}};
const int INF=0x3f3f3f3f;
const ll LLINF=0x3f3f3f3f3f3f3f3f;
const double PI=acos(-1.0);
const double eps=1e-4;
const int MAX=1e5+10;
const ll mod=1e9+7;
/***************************************  head  **********************************************/
int main()
{
	string s;
	int ans;
	while(cin>>s)
	{
		ans=0;
		for(i=0;i<3;i++) ans+=(s[i]=='1');
		printf("%d\n",ans);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:21: error: 'i' was not declared in this scope
   35 |                 for(i=0;i<3;i++) ans+=(s[i]=='1');
      |                     ^
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++;
  count << counter << endl;
  return 0;
}

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

#include <iosream>

using namespace std;

int main() {
  string number;
  int count = 0;
  if (number[0] == '1') {
    count++;
  }
  if (number[1] == '1') {
    count++;
  }
  if (number[2] == '1') {
    count++;
  }
  cout << cout << endl;
}


Compiler output:
a.cc:1:10: fatal error: iosream: No such file or directory
    1 | #include <iosream>
      |          ^~~~~~~~~
compilation terminated.
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:35: error: expected '}' at end of input
    9 |         cout << a + b + c << endl;
      |                                   ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include<iostream>
#include<string>
using namespace std ;
int v,i,N;
string a,b ;
int main(){
   v = 1000000
   cin >> a,b;
   for ( i =1 ; i<= N ; i = i + 1){
      while(a[i] % 2 == 0){
         a[i] = a[i]/2;
         b[i]++;
      }
      if( b[i] < v ){
         v = b[i] ;
      }
   }
   cout << v << endl ;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: expected ';' before 'cin'
    7 |    v = 1000000
      |               ^
      |               ;
    8 |    cin >> a,b;
      |    ~~~
Language: C++

#include<iostream>
#include<string>
using namespace std ;
int v,i,N, ;
string a,b ;
int main(){
   cin >> a,b;
   for ( i =1 ; i<= N ; i = i + 1){
      while(a[i] % 2 == 0){
         a[i] == a[i]/2;
         b[i]++;
      }
      if( b[i] < minv ){
         v = b[i] ;
      }
   }
   cout << v << endl ;
}

Compiler output:
a.cc:4:12: error: expected unqualified-id before ';' token
    4 | int v,i,N, ;
      |            ^
a.cc: In function 'int main()':
a.cc:13:18: error: 'minv' was not declared in this scope
   13 |       if( b[i] < minv ){
      |                  ^~~~
Language: C++

#include<iostream>
#include<string>
using namespace std ;
int minv,i,N, ;
string a,b ;
int main(){
   cin >> a,b;
   for ( i =1 ; i<= N ; i = i + 1){
      while(a[i] % 2 == 0){
         a[i] == a[i]/2;
         b[i]++;
      }
      if( b[i] < minv ){
         minv = b[i]
      }
   }
   cout << minv << endl ;
}


Compiler output:
a.cc:4:15: error: expected unqualified-id before ';' token
    4 | int minv,i,N, ;
      |               ^
a.cc: In function 'int main()':
a.cc:14:21: error: expected ';' before '}' token
   14 |          minv = b[i]
      |                     ^
      |                     ;
   15 |       }
      |       ~
Language: C++

#include<iostream>
#include<string>
using namespace std ;
int ans,i,N,b ;
string a ;
int main(){
   cin >> a;
   b ==0;
   for ( i =1 ; i<= N ; i = i + 1){
      if(a[i] % 2 == 0){
         b++;
            if(b == n){
                a[i] == a[i] / 2;
                ans++;      
            }
      }
   }
   cout << ans << endl ;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: 'n' was not declared in this scope
   12 |             if(b == n){
      |                     ^
Language: C++

#include<iostream>
#include<string>
using namespace std ;
int ans,i,N,b ;
string a ;
int main(){
   cin >> a;
   b ==0;
   for ( i =1 ; i<= N ; i = i + 1){
      if(a[i] % 2 == 0){
         b++;
            if(b == n;){
                a[i] == a[i] / 2;
                ans++;      
            }
      }
   }
   cout << ans << endl ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: 'n' was not declared in this scope
   12 |             if(b == n;){
      |                     ^
a.cc:12:23: error: expected primary-expression before ')' token
   12 |             if(b == n;){
      |                       ^
Language: C++

#include<iostream>
#include<string>
using namespace std ;
int ans,i ;
string a ;
int main(){
   cin >> a;
   for ( i =1 ; i<= n ; i = i + 1){
      if(a[i] % 2 == 0){
         a[i] == a[i] / 2;
         ans++;
      }
   }
   cout << ans << endl ;
}


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

#include<iostream>
using namespace std;

main(){
  char a[3];
  int ans=0;
  if (a[0]=="1") ans++;
  if (a[1]=="1") ans++;
  if (a[2]=="1") ans++;
  cout << ans << endl;
}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |   if (a[0]=="1") ans++;
      |       ~~~~^~~~~
a.cc:8:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |   if (a[1]=="1") ans++;
      |       ~~~~^~~~~
a.cc:9:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |   if (a[2]=="1") ans++;
      |       ~~~~^~~~~
Language: C++

#include<iostream>
#include<string>

using namespace 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: In function 'int main()':
a.cc:12:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 | if(s[0] == "1") ++cnt;
a.cc:13:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 | if(s[1] == "1") ++cnt;
a.cc:14:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 | if(s[2] == "1") ++cnt;
Language: C++

#include<iostream>
#include<string>

using namespace 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: In function 'int main()':
a.cc:12:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 | if(s[0] == "1") cnt++;
a.cc:13:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 | if(s[1] == "1") cnt++;
a.cc:14:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 | if(s[2] == "1") cnt++;
Language: C++

#include<iostream>
#include<string>

using 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:7: error: expected nested-name-specifier before 'namespase'
    4 | using 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)
      |     ^~~~