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

#include <stdio.h>

int main( void ) {
  short s[3];
  int i, cnt;
  scanf( "%d%d%d", &s[0], &s[1], &s[2] );

  cnt = 0;
  for ( i = 0, i++, i < 3 ) {
    if ( s[i] == 1 ) {
      cnt++;
    }
  }

  printf( "%d\n", cnt );

  return 0;
}

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

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

   }

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

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

   }

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

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

   }

Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: expected primary-expression before ']' token
    5 |  string s;]
      |           ^
a.cc:8:9: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |  if(s[0]=="1") ++counter
a.cc:8:25: error: expected ';' before 'if'
    8 |  if(s[0]=="1") ++counter
      |                         ^
      |                         ;
    9 |  if(s[1]=="1") ++counter
      |  ~~
Language: C++

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


Compiler output:
a.cc:15:3: error: expected unqualified-id before 'return'
   15 |   return 0;
      |   ^~~~~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: expected primary-expression before ';' token
    7 |   cin >> string;
      |                ^
a.cc:8:26: error: expected primary-expression before '.' token
    8 |   for(int i = 0; i<string.length(); ++i){
      |                          ^
a.cc:9:14: error: expected unqualified-id before '[' token
    9 |     if(string[i] == '1'){
      |              ^
a.cc: At global scope:
a.cc:15:3: error: expected unqualified-id before 'return'
   15 |   return 0;
      |   ^~~~~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C++

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

int main(){
  int i, o;
  cin >> input;
  if(i % 100){
    o++;
    i -= 100;
  }
  if ( i % 10 ){
    o++;
    i -= 10;
  }
  if ( i == 1 ){
    o++;
  }
  cout << o << endl;
}

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

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

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

	cin >> a;

	int counter = 0;
	std::string checkStr = ConvIntToStr(a);
	for (int i = 0; i < checkStr.length(); ++i)
	{
		if (checkStr[i] == '1')
		{
			++counter;
		}
	}
	cout << counter << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:32: error: 'ConvIntToStr' was not declared in this scope
   13 |         std::string checkStr = ConvIntToStr(a);
      |                                ^~~~~~~~~~~~
Language: C++

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

int main() {
  int S,s1,s2,s3;
  cin >> S ;

  s1=S/100
  s2=(S/10)-s1*10
  s3=S-s1*100-s2*10

  cout << s1+s2+s3 <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected ';' before 's2'
    8 |   s1=S/100
      |           ^
      |           ;
    9 |   s2=(S/10)-s1*10
      |   ~~
Language: C

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

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

Compiler output:
main.c: In function 'main':
main.c:10:26: error: expected ';' before ':' token
   10 |     for (int i = 0; i < 3 : i++)
      |                          ^~
      |                          ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s;
  int count=0;
  cin >> s;

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

  cout << count << endl;
      	
}

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

#include "stdc++.h"

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:1:10: fatal error: stdc++.h: No such file or directory
    1 | #include "stdc++.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++


#include "stdafx.h"
#include "stdc++.h"

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:2:10: fatal error: stdafx.h: No such file or directory
    2 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
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: conflicting declaration 'int s [2]'
    5 |         int s[1], s[2], s[3];
      |                   ^
a.cc:5:13: note: previous declaration as 'int s [1]'
    5 |         int s[1], s[2], s[3];
      |             ^
a.cc:5:25: error: conflicting declaration 'int s [3]'
    5 |         int s[1], s[2], s[3];
      |                         ^
a.cc:5:13: note: previous declaration as 'int s [1]'
    5 |         int s[1], s[2], s[3];
      |             ^
Language: C++

#include <iostream>
using namespace std;


int main(){
  char binary[3];
  cin >> binary;
  int counter = 0;
  int i;
  for(i = 0; i < sizeof(binary)/sizeof(*binary); i++){
  	if(binary[i] == "1"){
      counter++
    }
  }
  cout << counter << endl;
  return 0;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         if(binary[i] == "1"){
      |            ~~~~~~~~~~^~~~~~
a.cc:12:16: error: expected ';' before '}' token
   12 |       counter++
      |                ^
      |                ;
   13 |     }
      |     ~
Language: C++

    #include <bits/stdc++.h>
    using namespace std;
     
    int main() {
      int a;
      cin >> a;
      #aの下二桁(1かも)
      int b = a%100;
      #aの下一桁
      int c = b%10;
      
      cout << (a-b)/100 + (b-c)/10 + c << endl;
    }

Compiler output:
a.cc:7:8: error: invalid preprocessing directive #a\U0000306e\U00004e0b\U00004e8c\U00006841
    7 |       #aの下二桁(1かも)
      |        ^~~~~~~~~
a.cc:9:8: error: invalid preprocessing directive #a\U0000306e\U00004e0b\U00004e00\U00006841
    9 |       #aの下一桁
      |        ^~~~~~~~~
Language: C++

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

int main() {
  int couter;
  string num;
  cin >> num;
  
  for( int i = 0; i < 3; i++ ) {
    if( num.at(i) == 1 ) {
      counter++;
    }
  }
  
  cout << counter << endl;
}

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

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

int main() {
  int counter;
  vector<int> vec(3);
  cin >> vec.at(0) >> vec.at(1) >> vec.at(2);
  if( vec.at(0) == 1 ) {
    counter++;
  }
  if( vec.at(1) == 1 ) {
    couter++;
  }
  if( vec.at(2) == 1 ) {
    counter++;
  }
  
  cout << counter << endl;
}


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: expected primary-expression before ';' token
    6 |   cin >> a >>;
      |              ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: expected primary-expression before ';' token
    6 |   cin >> a >>;
      |              ^
a.cc:9:19: error: expected ';' before 'e'
    9 |   d = (b - c) / 10
      |                   ^
      |                   ;
   10 |   e = (a - b) / 100
      |   ~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |   if(i[0]=="1"){
a.cc:11:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |   }else if(i[1]=="1"){
a.cc:12:12: error: expected ';' before '}' token
   12 |     count++
      |            ^
      |            ;
   13 |   }else if(i[2]=="1"){
      |   ~         
a.cc:13:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |   }else if(i[2]=="1"){
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'String' was not declared in this scope
    5 |         String i;
      |         ^~~~~~
a.cc:6:16: error: 'i' was not declared in this scope
    6 |         cin >> i;
      |                ^
a.cc:11:12: error: expected ';' before '}' token
   11 |     count++
      |            ^
      |            ;
   12 |   }else if(i[2]=="1"){
      |   ~
Language: C++

#include<iostream>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> a;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:13:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |   cout << ret;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 's' was not declared in this scope
    8 |   if (s[0] == '1') ++cnt;
      |       ^
a.cc:9:7: error: 's' was not declared in this scope
    9 |   if (s[1] == '1') ++cnt;
      |       ^
a.cc:10:7: error: 's' was not declared in this scope
   10 |   if (s[2] == '1') ++cnt;
      |       ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 's' was not declared in this scope
    7 |   if (s[0] == '1') ++cnt;
      |       ^
a.cc:8:7: error: 's' was not declared in this scope
    8 |   if (s[1] == '1') ++cnt;
      |       ^
a.cc:9:7: error: 's' was not declared in this scope
    9 |   if (s[2] == '1') ++cnt;
      |       ^
Language: C++

#include <iostream>
#include <string>

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

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

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

int main() {
  string a;
  int count=0;
  for (i=0,i<3,i++) {
    if (s[i] == '1') {
      count++;
    }
  }
  cout << count << endl;
}


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

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

int main() {
  string a;
  int count=0;
  for (i=0,i<3,i++) {
    if (s[i] == '1') {
      count++;
    };
  };
  cout << count << endl;
}

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

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

int main(){
    int a, b, c, d, e, f;
    cin >> a;
    b=a%10;
    c=a-b;
    c=c/10;
    d=c%10;
    e=c-d;
    e=e/10;
    f=b+d+e;
    cout << f << \n;
    
}

Compiler output:
a.cc:14:18: error: stray '\' in program
   14 |     cout << f << \n;
      |                  ^
a.cc: In function 'int main()':
a.cc:14:19: error: 'n' was not declared in this scope
   14 |     cout << f << \n;
      |                   ^
Language: C++

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

int main() {

  int a;
  cin>>a>>;
  cout<<a%3<<endl;
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: expected primary-expression before ';' token
    7 |   cin>>a>>;
      |           ^
Language: C++

#include<iostream>
#include<string>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'string' was not declared in this scope
    5 |   string s;
      |   ^~~~~~
a.cc:5: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:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   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:6:10: error: 's' was not declared in this scope
    6 |   cin >> s;
      |          ^
a.cc:13:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |   cout << count << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:13:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 |   cout << count << 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;
  cin>>a;
  cout<<a/100+(a/10)%10+(a%100)%10

Compiler output:
a.cc: In function 'int main()':
a.cc:6:35: error: expected ';' at end of input
    6 |   cout<<a/100+(a/10)%10+(a%100)%10
      |                                   ^
      |                                   ;
a.cc:6:35: error: expected '}' at end of input
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

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

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

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

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

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

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

#include<stdio.h>


int main(void){
    int a;
    scanf("%d",&a);
    if(a==111){printf("3");}
    if(a==101||a==110||a==011){printf("2");}
    if(a==001||a==010||a==100){printf("1");}
    if(a==000){printf("0")}


    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:27: error: expected ';' before '}' token
   10 |     if(a==000){printf("0")}
      |                           ^
      |                           ;
Language: C++

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

int main() {
  char s;
  cin >> s;
  cout << count(s.begin(), s.end(), "1") << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: request for member 'begin' in 's', which is of non-class type 'char'
    8 |   cout << count(s.begin(), s.end(), "1") << endl;
      |                   ^~~~~
a.cc:8:30: error: request for member 'end' in 's', which is of non-class type 'char'
    8 |   cout << count(s.begin(), s.end(), "1") << endl;
      |                              ^~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: invalid types 'char[int]' for array subscript
    8 |   cout << s[0]+s[1]+s[2] << endl;
      |            ^
a.cc:8:17: error: invalid types 'char[int]' for array subscript
    8 |   cout << s[0]+s[1]+s[2] << endl;
      |                 ^
a.cc:8:22: error: invalid types 'char[int]' for array subscript
    8 |   cout << s[0]+s[1]+s[2] << endl;
      |                      ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: invalid types 'char[int]' for array subscript
    8 |   cout << int(s[0]+s[1]+s[2] << endl;
      |                ^
a.cc:8:21: error: invalid types 'char[int]' for array subscript
    8 |   cout << int(s[0]+s[1]+s[2] << endl;
      |                     ^
a.cc:8:26: error: invalid types 'char[int]' for array subscript
    8 |   cout << int(s[0]+s[1]+s[2] << endl;
      |                          ^
Language: C++

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

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

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

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

#include <bits/stdc++.h>
#include <iostream>

using namespace std;
int main() {
  char s;
  cin >> s;
  cout << int(s[1]) + int(s[2]) + int(s[3]) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: invalid types 'char[int]' for array subscript
    8 |   cout << int(s[1]) + int(s[2]) + int(s[3]) << endl;
      |                ^
a.cc:8:28: error: invalid types 'char[int]' for array subscript
    8 |   cout << int(s[1]) + int(s[2]) + int(s[3]) << endl;
      |                            ^
a.cc:8:40: error: invalid types 'char[int]' for array subscript
    8 |   cout << int(s[1]) + int(s[2]) + int(s[3]) << endl;
      |                                        ^
Language: C++

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

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

#include <bits/stdc++.h>
using namespace std;
int main() {
  char s_1, s_2, s_3;
  cin >> s_1s_2s_3;
  cout << int(s_1) + int(s_2) + int(s_3) << endl;
}

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

#include <bits/stdc++.h>
using namespace std;
int main() {
  int s_1, s_2, s_3;
  cin >> s_1s_2s_3;
  cout << s_1 + s_2 + s_3 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: 's_1s_2s_3' was not declared in this scope
    5 |   cin >> s_1s_2s_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/1 + s_2/1 + s_3/1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:31: error: expected primary-expression before ';' token
    5 |   cin >> s_1 >> s_2 >> s_3 >> ;
      |                               ^
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
    8 |   if(S.at[0] == '1')ans++;
      |          ^
a.cc:9:10: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
    9 |   if(S.at[1] == '1')ans++;
      |          ^
a.cc:10:10: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   10 |   if(S.at[2] == '1')ans++;
      |          ^
Language: C++

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

Compiler output:
a.cc:3:1: error: 'c' does not name a type
    3 | c
      | ^
Language: C++

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

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

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

#include <iostream>
using namespace std;
int main(void){
    int a,b,c,;
    cin>>a>>b>>c;
    cout<<a+b+c<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:15: error: expected unqualified-id before ';' token
    4 |     int a,b,c,;
      |               ^
Language: C++

#include <iostream>
#include <string>

namespace std;

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

  int counter;

  for( int i = 0; i < 2; i++ ) {
    if( s[i] == '1' )
      counter++;
  }
  cout << counter << endl;
  return 0;
}

Compiler output:
a.cc:4:14: error: expected '{' before ';' token
    4 | namespace std;
      |              ^
a.cc: In function 'int main()':
a.cc:7:3: error: 'string' was not declared in this scope
    7 |   string s;
      |   ^~~~~~
a.cc:7: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:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   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:8:10: error: 's' was not declared in this scope
    8 |   cin >> s;
      |          ^
a.cc:16:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |   cout << counter << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 |   cout << counter << endl;
      |                      ^~~~
      |                      std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C

void count(){
  int mas[3];
  int count = 0;
  scanf("%1d%1d%1d", &mas[0], &mas[1], &mas[2]);

  for(int i=0; i<sizeof(mas)/sizeof(mas[0]); i++){
    if(mas[i] != 0){
      count++
    }
  }
  printf("%d", count); 
}

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

Compiler output:
main.c: In function 'count':
main.c:4:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |   scanf("%1d%1d%1d", &mas[0], &mas[1], &mas[2]);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | void count(){
main.c:4:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |   scanf("%1d%1d%1d", &mas[0], &mas[1], &mas[2]);
      |   ^~~~~
main.c:4:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:8:14: error: expected ';' before '}' token
    8 |       count++
      |              ^
      |              ;
    9 |     }
      |     ~         
main.c:11:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   11 |   printf("%d", count);
      |   ^~~~~~
main.c:11:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:11:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:11:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

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

int main(){
  int count;
  string s;
  cin>>string;
  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:8:14: error: expected primary-expression before ';' token
    8 |   cin>>string;
      |              ^
Language: Java

import java.util.Scanner;
 
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();
        
 
        int count = 0;
 
        for(char x: str.toCharArray()){
            if(x == '1'){
                count++;
            }
        }
        System.out.println(count);
    }
}

Compiler output:
Main.java:11: error: cannot find symbol
        for(char x: str.toCharArray()){
                    ^
  symbol:   variable str
  location: class Main
1 error
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:3:3: error: unknown type name 'str'
    3 |   str s;
      |   ^~~
main.c:7:9: error: subscripted value is neither array nor pointer nor vector
    7 |     if(s[i]==1){
      |         ^
Language: Java

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


Compiler output:
Main.java:7: error: variable counter might not have been initialized
    if(s.substring(0,1).equals(1)){++counter;}
                                     ^
Main.java:8: error: variable counter might not have been initialized
    if(s.substring(1,2).equals(1)){++counter;}
                                     ^
Main.java:9: error: variable counter might not have been initialized
    if(s.substring(2,3).equals(1)){++counter;}
                                     ^
3 errors
Language: C++

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

int main(){
  int s
  cin >>s;
  
  int a;
  a = s /100;//100の位
  int b;
  b = a*100;
  int p;
  p = s - b;//10の位と1のくらい
  
  int c;
  c = p/10;//10の位
  int d;
  d = c *10;
  int q;
  q = p - d;//1の位
  
  cout<<a+c+q<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'cin'
    6 |   cin >>s;
      |   ^~~
a.cc:9:7: error: 's' was not declared in this scope
    9 |   a = s /100;//100の位
      |       ^
Language: C++

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

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

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'nameplace'
    2 | using nameplace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> s1 >> s2 >> s3;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |   cout << s1 + s2 + s3 << 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:7:27: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |   cout << s1 + s2 + s3 << endl;
      |                           ^~~~
      |                           std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

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

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

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

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

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


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

/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: expected initializer before '==' token
   17 |     int ans==0;
      |            ^~
a.cc:19:23: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |         if(s[i]=='1') ans++;
      |                       ^~~
      |                       abs
a.cc:21:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |     cout<<ans;
      |           ^~~
      |           abs
Language: C++

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

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

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

/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: expected initializer before '==' token
   17 |     int ans==0
      |            ^~
a.cc:18:17: error: 'i' was not declared in this scope
   18 |     for(int i=0;i<3;i++){
      |                 ^
a.cc:21:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |     cout<<ans;
      |           ^~~
      |           abs
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		//データ取り込み
		Scanner sc = new Scanner(System.in);
		//String S = sc.next();
		//int N = sc.nextInt();
		//System.out.println();
		String S = sc.next();
		int cnt = 0;
		
		for(a : S.toCharArray()){
			if(a == '1'){
				cnt++;
			}
		}
		System.out.println(cnt);
	}
}


Compiler output:
Main.java:12: error: bad initializer for for-loop
		for(a : S.toCharArray()){
		    ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(I,A,B) for(ll I = int(A); I < int(B); ++I)
int main(){
	string s;
	cin >> s;
	int ans = 0;
	FOR(i,0,3)if(s[i]=='1')ans++;
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:24: error: 'll' was not declared in this scope
    3 | #define FOR(I,A,B) for(ll I = int(A); I < int(B); ++I)
      |                        ^~
a.cc:8:9: note: in expansion of macro 'FOR'
    8 |         FOR(i,0,3)if(s[i]=='1')ans++;
      |         ^~~
a.cc:8:13: error: 'i' was not declared in this scope
    8 |         FOR(i,0,3)if(s[i]=='1')ans++;
      |             ^
a.cc:3:39: note: in definition of macro 'FOR'
    3 | #define FOR(I,A,B) for(ll I = int(A); I < int(B); ++I)
      |                                       ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: expected ';' before '}' token
   10 |     if(s[i]>0) count++
      |                       ^
      |                       ;
   11 |   }
      |   ~
Language: C++

#include<bits/stdc++.h>

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

  cout << counter << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   string s;
      |   ^~~~~~
a.cc:4:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> s;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:10: error: 's' was not declared in this scope
    6 |   cin >> s;
      |          ^
a.cc:14:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |   cout << counter << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:14:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 |   cout << counter << endl;
      |                      ^~~~
      |                      std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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


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

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

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

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

Compiler output:
main.c: In function 'main':
main.c:7:21: error: invalid operands to binary & (have 'char *' and 'int')
    7 |       scanf("%d%d%d"&a,&b,&c);
      |             ~~~~~~~~^
      |             |
      |             char *
main.c:19:7: error: expected declaration or statement at end of input
   19 |       return 0;
      |       ^~~~~~
Language: C

    #include<stdio.h>
     
    int main(){
     
      int a,b,c;
      int count;
      scanf("%d%d%d",&a,&b,&c);
      a == 1 ? (count++) : () ;
      b == 1 ? (count++) : () ;
      c == 1 ? (count++) : () ;
      print("%d",count);
      return 0;
    }

Compiler output:
main.c: In function 'main':
main.c:8:29: error: expected expression before ')' token
    8 |       a == 1 ? (count++) : () ;
      |                             ^
main.c:9:29: error: expected expression before ')' token
    9 |       b == 1 ? (count++) : () ;
      |                             ^
main.c:10:29: error: expected expression before ')' token
   10 |       c == 1 ? (count++) : () ;
      |                             ^
main.c:11:7: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   11 |       print("%d",count);
      |       ^~~~~
      |       printf
Language: C

#include<stdio.h>

int main(){

  int a,b,c;
  int count;
  scanf("%d%d%d",&a,&b,&c);
  a == 1 ? (count++) : ;
  b == 1 ? (count++) : ;
  c == 1 ? (count++) : ;
  print("%d",count);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:24: error: expected expression before ';' token
    8 |   a == 1 ? (count++) : ;
      |                        ^
main.c:9:24: error: expected expression before ';' token
    9 |   b == 1 ? (count++) : ;
      |                        ^
main.c:10:24: error: expected expression before ';' token
   10 |   c == 1 ? (count++) : ;
      |                        ^
main.c:11:3: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   11 |   print("%d",count);
      |   ^~~~~
      |   printf
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected initializer before 'cin'
    7 |   cin >> a >> b >> c;
      |   ^~~
a.cc:10:3: error: 'c' was not declared in this scope
   10 |   c = c % (c - 1);
      |   ^
Language: C++

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

int main() {
  string s;
  int t =0;
  cin >> s ;
  for(int i = 1; i < 3; i++){
    if(s.at(i) = 1){
      t +=1;
    }
  }
  cou << t << endl;
}


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

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

int main() {
  string s;
  int t =0;
  cin >> s ;
  for(int i = 1, i < 3, i++){
    if(s.at(i) = 1){
      t +=1;
    }
  }
  cou << t << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: expected ';' before '<' token
    8 |   for(int i = 1, i < 3, i++){
      |                   ^~
      |                   ;
a.cc:8:20: error: expected primary-expression before '<' token
    8 |   for(int i = 1, i < 3, i++){
      |                    ^
a.cc:8:28: error: expected ';' before ')' token
    8 |   for(int i = 1, i < 3, i++){
      |                            ^
      |                            ;
a.cc:13:3: error: 'cou' was not declared in this scope; did you mean 'cos'?
   13 |   cou << t << endl;
      |   ^~~
      |   cos