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

#include<iostream>
using namespace std;

int main() {
  int s;
  vector<int> vec(3);
  
  for (int i=0; i<3; i++) cin >> vec.at(i);
  
  int s=0;
  if (vec.at(i) == 1) {
    s += vec.at(i) 
  }
  cout << s << endl;
}

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

#include<bits/stdc++.h>

using namespace std;

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

    int ans=0;

    for(int i=0;i<=2;i++){
        if (g[i]==1){
            ans+=1;
        }
    }
    cout << ans;
    return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:17:14: error: expected '}' at end of input
   17 |     return 0;
      |              ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include <iostream>

using namespace std;

int main()
{
    int N , A , B;
    cin >> N >> A >> B;
    cout << N + A + B
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: expected ';' before '}' token
    9 |     cout << N + A + B
      |                      ^
      |                      ;
   10 | }
      | ~
Language: C++

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

int main() {
  int xyz;
  cin >> x >> y >> z;
  cout << x+y+z << endl;
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:14: error: expected initializer before 's3'
    5 |   int s1, s2 s3;
      |              ^~
a.cc:6:16: error: 's2' was not declared in this scope; did you mean 's1'?
    6 |   cin >> s1 >> s2 >> s3;
      |                ^~
      |                s1
a.cc:6:22: error: 's3' was not declared in this scope; did you mean 's1'?
    6 |   cin >> s1 >> s2 >> s3;
      |                      ^~
      |                      s1
Language: C++

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

int main() {
    int a;
    cin >> a;
    int 一桁目,二桁目,三桁目;
    一桁目 = a / 100;
    二桁目 = (a - 一桁目 * 100) / 10;
    三桁目 = a - 三桁目 * 100 - 二桁目 * 10;
    cout << 一桁目 + 二桁目 + 三人目;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:31: error: '\U00004e09\U00004eba\U000076ee' was not declared in this scope; did you mean '三桁目'?
   11 |     cout << 一桁目 + 二桁目 + 三人目;
      |                               ^~~~~~
      |                               三桁目
Language: C++

#include<iostream>
#include<string>
 
#define fastio()                ios_base::sync_with_stdio(false);cin.tie(NULL)
#define ll                      long long int
#define ull                     unsigned long long int
#define inp(n)                  ll n; cin >> n
#define inpc(c)                 char c; cin >> c
#define inps(s)                 string s; cin >> s
#define print(x)                cout << x << " "
#define nl                      cout << '\n'
#define pyes                    cout << "YES"
#define pno                     cout << "NO"
#define fr(i,a,b)               for(ll i=a; i<b; ++i)
#define frrev(i,b,a)            for(ll i=b; i<=a; --i)
#define strrev(s)               reverse(s.begin(), s.end())
#define pb(x)                   push_back(x)
#define vin(A, n)               vector<ll> A; fr(i,0,n){ ll x; cin >> x; A.pb(x); }
#define vinc(A, n)              vector<char> A; fr(i,0,n){ char x; cin >> x; A.pb(x); }
#define vpairin(A, n, t1, t2)   vector<pair<t1,t2> > A; fr(i,0,n) {t1 x; t2 y; cin >> x >> y; A.pb(make_pair(x,y));}
#define srt(A)                  sort(A.begin(), A.end())
#define vout(A, n)              fr(i,0,n){ print(A[i]); }
#define vpairout(A, n)          fr(i,0,n){ print(A[i].first); print(A[i].second); nl; }
 
using namespace std;

void solve()
{
	string n;
	cin >> n;
	int marbles = 0;
	for (int i = 0; i < n.lenght(); ++i)
	{
		/* code */
		if (n[i] == 1)
			marbles++;
	}
	cout << marbles;

}
 
int main()
{
 
   fastio();
   solve();
   
 
   return 0;
}
 

Compiler output:
a.cc: In function 'void solve()':
a.cc:32:31: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenght'; did you mean 'length'?
   32 |         for (int i = 0; i < n.lenght(); ++i)
      |                               ^~~~~~
      |                               length
Language: C++

#include<iostream>
 
#define fastio()                ios_base::sync_with_stdio(false);cin.tie(NULL)
#define ll                      long long int
#define ull                     unsigned long long int
#define inp(n)                  ll n; cin >> n
#define inpc(c)                 char c; cin >> c
#define inps(s)                 string s; cin >> s
#define print(x)                cout << x << " "
#define nl                      cout << '\n'
#define pyes                    cout << "YES"
#define pno                     cout << "NO"
#define fr(i,a,b)               for(ll i=a; i<b; ++i)
#define frrev(i,b,a)            for(ll i=b; i<=a; --i)
#define strrev(s)               reverse(s.begin(), s.end())
#define pb(x)                   push_back(x)
#define vin(A, n)               vector<ll> A; fr(i,0,n){ ll x; cin >> x; A.pb(x); }
#define vinc(A, n)              vector<char> A; fr(i,0,n){ char x; cin >> x; A.pb(x); }
#define vpairin(A, n, t1, t2)   vector<pair<t1,t2> > A; fr(i,0,n) {t1 x; t2 y; cin >> x >> y; A.pb(make_pair(x,y));}
#define srt(A)                  sort(A.begin(), A.end())
#define vout(A, n)              fr(i,0,n){ print(A[i]); }
#define vpairout(A, n)          fr(i,0,n){ print(A[i].first); print(A[i].second); nl; }
 
using namespace std;

void solve()
{
	string n;
	cin >> n;
	int marbles = 0;
	for (int i = 0; i < n.lenght(); ++i)
	{
		/* code */
		if (n[i] == 1)
			marbles++;
	}
	cout << marbles;

}
 
int main()
{
 
   fastio();
   solve();
   
 
   return 0;
}
 

Compiler output:
a.cc: In function 'void solve()':
a.cc:31:31: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenght'; did you mean 'length'?
   31 |         for (int i = 0; i < n.lenght(); ++i)
      |                               ^~~~~~
      |                               length
Language: C++

#include<bits/stdc++.h>
 
#define fastio()                ios_base::sync_with_stdio(false);cin.tie(NULL)
#define ll                      long long int
#define ull                     unsigned long long int
#define inp(n)                  ll n; cin >> n
#define inpc(c)                 char c; cin >> c
#define inps(s)                 string s; cin >> s
#define print(x)                cout << x << " "
#define nl                      cout << '\n'
#define pyes                    cout << "YES"
#define pno                     cout << "NO"
#define fr(i,a,b)               for(ll i=a; i<b; ++i)
#define frrev(i,b,a)            for(ll i=b; i<=a; --i)
#define strrev(s)               reverse(s.begin(), s.end())
#define pb(x)                   push_back(x)
#define vin(A, n)               vector<ll> A; fr(i,0,n){ ll x; cin >> x; A.pb(x); }
#define vinc(A, n)              vector<char> A; fr(i,0,n){ char x; cin >> x; A.pb(x); }
#define vpairin(A, n, t1, t2)   vector<pair<t1,t2> > A; fr(i,0,n) {t1 x; t2 y; cin >> x >> y; A.pb(make_pair(x,y));}
#define srt(A)                  sort(A.begin(), A.end())
#define vout(A, n)              fr(i,0,n){ print(A[i]); }
#define vpairout(A, n)          fr(i,0,n){ print(A[i].first); print(A[i].second); nl; }
 
using namespace std;

void solve()
{
	string n;
	cin >> n;
	int marbles = 0;
	for (int i = 0; i < n.lenght(); ++i)
	{
		/* code */
		if (n[i] == 1)
			marbles++;
	}
	cout << marbles;

}
 
int main()
{
 
   fastio();
   solve();
   
 
   return 0;
}
 

Compiler output:
a.cc: In function 'void solve()':
a.cc:31:31: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'lenght'; did you mean 'length'?
   31 |         for (int i = 0; i < n.lenght(); ++i)
      |                               ^~~~~~
      |                               length
Language: C++

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

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

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

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

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

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

Compiler output:
main.c: In function 'main':
main.c:4:15: error: expected identifier or '(' before ';' token
    4 |     int i,c=0,;
      |               ^
main.c:5:15: error: invalid operands to binary & (have 'char *' and 'int *')
    5 |     scanf("%d"&s);
      |           ~~~~^
      |           |   |
      |           |   int *
      |           char *
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:4:15: error: expected identifier or '(' before ';' token
    4 |     int i,c=0,;
      |               ^
Language: C

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

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

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

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

#include <stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:10:14: warning: comparison between pointer and integer
   10 |     if(str[i]=="1"){
      |              ^~
main.c:15:3: error: 'return0' undeclared (first use in this function)
   15 |   return0;
      |   ^~~~~~~
main.c:15:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:10:14: warning: comparison between pointer and integer
   10 |     if(str[i]=="1"){
      |              ^~
main.c:15:3: error: 'return0' undeclared (first use in this function)
   15 |   return0;
      |   ^~~~~~~
main.c:15:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:7:15: error: 's' undeclared (first use in this function)
    7 |   scanf("%s",&s);
      |               ^
main.c:7:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:14: warning: comparison between pointer and integer
   10 |     if(str[i]=="1"){
      |              ^~
main.c:15:3: error: 'return0' undeclared (first use in this function)
   15 |   return0;
      |   ^~~~~~~
Language: C++

#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 << endl;
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: expected '}' at end of input
   14 |     return 0;
      |              ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
 
int main() {
  const static int NUM_OF_BOXES = 3;
  char boxes[3];
  std::cin >> boxes;
  int numOfBalls = 0;
  for (size_t i = 0U; i << NUM_OF_BOXES; ++i) {
    if (boxes.at(i) == '1') {
      numOfBalls++;
    }
  }
  std::cout << numOfBalls;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: request for member 'at' in 'boxes', which is of non-class type 'char [3]'
    9 |     if (boxes.at(i) == '1') {
      |               ^~
Language: C++

#include <iostream>
#include <string>

int main() {
  std::string boxes = "";
  std::cin >> boxes;
  int numOfBalls = 0:;
  for (size_t i = 0U; i << boxes.size(); ++i) {
    if (boxes[i] == '1') {
      numOfBalls++;
    }
  }
  std::cout << numOfBalls;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:21: error: expected ',' or ';' before ':' token
    7 |   int numOfBalls = 0:;
      |                     ^
Language: C++


;
1
#include <cstdio>
2
​
3
int main()
4
{
5
    int a;
6
    scanf("%d", &a);
7
    if(a==000)
8
    {
9
        printf("0");
10
    }
11
    else if(a==001)
12
    {
13
        printf("1");
14
    }
15
    else if(a==010)
16
    {
17
        printf("1");
18
    }
19
    else if(a==100)
20
    {
21
        printf("1");
22
    }
23
    else if(a==101)
24
    {
25
        printf("2");
26
    }
27
    else if(a==110)
28
    {
29
        printf("2");
30
    }
31
    else if(a==111)
32
    {
33
        printf("3");
34
    }
35
}


Compiler output:
a.cc:3:1: error: expected unqualified-id before numeric constant
    3 | 1
      | ^
a.cc:5:1: error: expected unqualified-id before numeric constant
    5 | 2
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {

  int s1;
  int s2;
  int s3;
  
  cin >> s1 >> s2 >> s3 ;
  
  cout << s1+s2+s3 << endl;  

Compiler output:
a.cc: In function 'int main()':
a.cc:13:28: error: expected '}' at end of input
   13 |   cout << s1+s2+s3 << endl;
      |                            ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)

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


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

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)

int main(){
  stirng a;
  cin >> a;
  
  int count = 0;
  rep(i,3){
    if(a[i] == "1") count++;
  }
  
  cout << count << endl;
  
  return 0;
}

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

#include <cstdio>

int main()
{
    int a;
    scanf("%d", &a);
    int num = 0;
    if (a % 10 == 1)
    {
        num = num + 1;
    }
    
    if ((a / 10) % 10 == 1)
    {
        num = num + 1;
    }
    
    if (a / 100 == 1)
    {
        num = num + 1;
    }
    printf("%d", a)
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:20: error: expected ';' before '}' token
   22 |     printf("%d", a)
      |                    ^
      |                    ;
   23 | 
   24 | }
      | ~
Language: C++

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

int main() {

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: request for member 'at' in 'vector', which is of non-class type 'int'
    8 |   cin >> vector.at(i);
      |                 ^~
a.cc:13:16: error: request for member 'at' in 'vector', which is of non-class type 'int'
   13 |     if (vector.at(i) == 1){
      |                ^~
Language: C++

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

int main() {

  int a, b, c;
  sin >> a >> b >> c;
  int count;
  count = 0;
  if (a == 1){
    count++;
  }
  if (b == 1){
    count++;
  }
  if (c == 1){
    count++;
  }
  count << count << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator>>'
    7 |   sin >> a >> b >> c;
      |   ~~~~^~~~
a.cc:19:18: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   19 |   count << count << endl;
      |   ~~~~~~~~~~~~~~~^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  int A
  int B,C,D;
  //A = 10;
  
  B = A / 100; //100のくらい
  C = A % 2; //1の位
  D = A / 10 % 10; //10の位
  
 
  cout << B << endl;
  cout << D << endl;
  cout << C << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected initializer before 'int'
    7 |   int B,C,D;
      |   ^~~
a.cc:10:3: error: 'B' was not declared in this scope
   10 |   B = A / 100; //100のくらい
      |   ^
a.cc:10:7: error: 'A' was not declared in this scope
   10 |   B = A / 100; //100のくらい
      |       ^
a.cc:11:3: error: 'C' was not declared in this scope
   11 |   C = A % 2; //1の位
      |   ^
a.cc:12:3: error: 'D' was not declared in this scope
   12 |   D = A / 10 % 10; //10の位
      |   ^
Language: Java

public class Main {
    public static void main(String[] args) {
      int s₁ = new java.util.Random().nextInt(2);
      int s₂ = new java.util.Random().nextInt(2);
      int s₃ = new java.util.Random().nextInt(2);
      System.out.println(s₁ + s₂ + s₃);
    }
}


Compiler output:
Main.java:3: error: illegal character: '\u2081'
      int s? = new java.util.Random().nextInt(2);
           ^
Main.java:4: error: illegal character: '\u2082'
      int s? = new java.util.Random().nextInt(2);
           ^
Main.java:5: error: illegal character: '\u2083'
      int s? = new java.util.Random().nextInt(2);
           ^
Main.java:6: error: illegal character: '\u2081'
      System.out.println(s? + s? + s?);
                          ^
Main.java:6: error: illegal character: '\u2082'
      System.out.println(s? + s? + s?);
                               ^
Main.java:6: error: not a statement
      System.out.println(s? + s? + s?);
                              ^
Main.java:6: error: illegal character: '\u2083'
      System.out.println(s? + s? + s?);
                                    ^
Main.java:6: error: not a statement
      System.out.println(s? + s? + s?);
                                   ^
8 errors
Language: Java

public class Main1 {
    public static void main(String[] args) {
      int s₁ = new java.util.Random().nextInt(2);
      int s₂ = new java.util.Random().nextInt(2);
      int s₃ = new java.util.Random().nextInt(2);
      System.out.println(s₁ + s₂ + s₃)
    }
}

Compiler output:
Main.java:3: error: illegal character: '\u2081'
      int s? = new java.util.Random().nextInt(2);
           ^
Main.java:4: error: illegal character: '\u2082'
      int s? = new java.util.Random().nextInt(2);
           ^
Main.java:5: error: illegal character: '\u2083'
      int s? = new java.util.Random().nextInt(2);
           ^
Main.java:6: error: illegal character: '\u2081'
      System.out.println(s? + s? + s?)
                          ^
Main.java:6: error: illegal character: '\u2082'
      System.out.println(s? + s? + s?)
                               ^
Main.java:6: error: not a statement
      System.out.println(s? + s? + s?)
                              ^
Main.java:6: error: illegal character: '\u2083'
      System.out.println(s? + s? + s?)
                                    ^
Main.java:6: error: not a statement
      System.out.println(s? + s? + s?)
                                   ^
8 errors
Language: C++

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

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


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

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

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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: expected ';' before 'i'
    8 |   for (int i = 0; i < 3 i++){
      |                        ^~
      |                        ;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: found ':' in nested-name-specifier, expected '::'
    5 |   string s:
      |           ^
      |           ::
a.cc:5:10: error: 's' has not been declared
    5 |   string s:
      |          ^
a.cc:6:7: error: qualified-id in declaration before '>>' token
    6 |   cin >> s;
      |       ^~
a.cc:8:24: error: expected ';' before 'i'
    8 |   for (int i = 0; i < 3 i++){
      |                        ^~
      |                        ;
a.cc:9:9: error: 's' was not declared in this scope
    9 |     if (s[i] == 1)
      |         ^
Language: C++

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


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

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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:4:14: error: array must be initialized with a brace-enclosed initializer
    4 |     int a[3]=0;
      |              ^
Language: C++

#include<iostream>

using namespace std;

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 << a;
	return 0;
}



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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b[2];
  int count = 0;
  cin >> a;
  b[0] = a - a%100;
  b[1] = b[0] - b[0]%10;
  b[2] = b[1]%10
  if(b[0] == 100){
    count++;
  }
  if(b[1] == 10){
    count++;
  }
  if(b[2] == 1){
    count++;
  }
  
  cout << count;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: expected ';' before 'if'
   10 |   b[2] = b[1]%10
      |                 ^
      |                 ;
   11 |   if(b[0] == 100){
      |   ~~
Language: C++

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

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

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

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

/**
 * auther: m0r1r1n
 */

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define fi first
#define se second

int main(int argc, char* argv[]) {
  
  int S;
  
  cin >> S;
  
  if ( S == "111" ) {
    
    cout << 3 << endl;
  }
  
  else if ( S == "110" ) {
    
    cout << 2 << endl;
  }
  
  else if ( S == "101" ) {
    
    cout << 2 << endl;
  }
  
  else if ( S == "011" ) {
    
    cout << 2 << endl;
  }
  
  else if ( S == "100" ) {
    
    cout << 1 << endl;
  }
  
  else if ( S == "010" ) {
    
    cout << 1 << endl;
  }
  
  else if ( S == "001" ) {
    
    cout << 1 << endl;
  }
  
  else {
    
    cout << 0 << endl;
  }

    return 0;
}





Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:42:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   42 |   if ( S == "111" ) {
      |        ~~^~~~~~~~
a.cc:47:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   47 |   else if ( S == "110" ) {
      |             ~~^~~~~~~~
a.cc:52:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   52 |   else if ( S == "101" ) {
      |             ~~^~~~~~~~
a.cc:57:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   57 |   else if ( S == "011" ) {
      |             ~~^~~~~~~~
a.cc:62:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   62 |   else if ( S == "100" ) {
      |             ~~^~~~~~~~
a.cc:67:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   67 |   else if ( S == "010" ) {
      |             ~~^~~~~~~~
a.cc:72:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   72 |   else if ( S == "001" ) {
      |             ~~^~~~~~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'si' was not declared in this scope; did you mean 's3'?
    9 |   ans = si+s2+s3;
      |         ^~
      |         s3
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:10:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 | if (s[0] == "1") ++counter;
a.cc:11:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 | if (s[1] == "1") ++counter;
a.cc:12:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 | if (s[2] == "1") ++counter;
Language: C++

#include <iostream>
using namespace std;

int main() {
  
  int S;
  
  cin >> S;
  
  if ( S == 111 ) {
    
    cout << 3 << endl;
  }
  
  else if ( S == 110 & S == 101 & S == 011 & ) {
    
    cout << 2 << endl;
  }
  
  else if ( S == 100 & S == 010 & S == 001 ) {
    
    cout << 1 << endl;
  }
  
  else {
    
    cout << 0 << endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:46: error: expected primary-expression before ')' token
   15 |   else if ( S == 110 & S == 101 & S == 011 & ) {
      |                                              ^
Language: Java

import java.util.*;

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

Compiler output:
Main.java:6: error: variable sc is already defined in method main(String[])
        Scanner sc = new Scanner(System.in);
                ^
Main.java:9: error: method replaceAll in class String cannot be applied to given types;
        s = s.replaceAll("0");
             ^
  required: String,String
  found:    String
  reason: actual and formal argument lists differ in length
2 errors
Language: C++

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

int main() {
  int s[1];
  int s[2];
  int 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:6:7: error: conflicting declaration 'int s [2]'
    6 |   int s[2];
      |       ^
a.cc:5:7: note: previous declaration as 'int s [1]'
    5 |   int s[1];
      |       ^
a.cc:7:7: error: conflicting declaration 'int s [3]'
    7 |   int s[3];
      |       ^
a.cc:5:7: note: previous declaration as 'int s [1]'
    5 |   int s[1];
      |       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main (){
  vector<char> data;
  int sum = 0;
  
  //データ入力
  for(int i =0;i < 3; i++ ){
    cin >> data.at(i);
  }
  //カウント機能
  for(int i =0;i < 3; i++ ){
    if(data.at(i) == '1'){
    sum++:  
    }
  }
  
  cout << sum <<endl;
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: expected ';' before ':' token
   14 |     sum++:
      |          ^
      |          ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main (){
  vector<int> data;
  int sum = 0;
  
  //データ入力
  for(int i =0;i < 3; i++ ){
    cin >> data.at(i);
  }
  //カウント機能
  for(int i =0;i < 3; i++ ){
    if(data.at(i) == 1){
    sum++:  
    }
  }
  
  cout << sum <<endl;
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: expected ';' before ':' token
   14 |     sum++:
      |          ^
      |          ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main (){
  vector<int> data;
  int sum = 0;
  
  //データ入力
  for(int i =0;i < 3; i++ ){
    cin >> data.at(i);
  }
  //カウント機能
  for(int i =0;i < 3; i++ ){
    if(data.at(i) == 1)
    sum++:  
  }
  
  cout << sum <<endl;
  
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: expected ';' before ':' token
   14 |     sum++:
      |          ^
      |          ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
 main int (){
  vector<int> data;
  int sum = 0;
  
  //データ入力
  for(int i =0;i < 3; i++ ){
    cin >> data.at(i);
  }
  //カウント機能
  for(int i =0;i < 3; i++ ){
    if(data.at(i) == 1)
    sum++:  
  }
  
  cout << sum <<endl;
  
  
}


Compiler output:
a.cc:3:2: error: 'main' does not name a type
    3 |  main int (){
      |  ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
void check (int num){
  vector<int> data;
  int sum = 0;
  //データ入力
  for(i =0;i < 3; i++ ){
    cin >> data.at(i);
  }
  //カウント機能
  for(i =0;i < 3; i++ ){
    if(data.at(i) == 1)
    sum++:  
  }
  
  cout << sum <<endl;
  
  
}

Compiler output:
a.cc: In function 'void check(int)':
a.cc:7:7: error: 'i' was not declared in this scope
    7 |   for(i =0;i < 3; i++ ){
      |       ^
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   for(i =0;i < 3; i++ ){
      |       ^
a.cc:13:10: error: expected ';' before ':' token
   13 |     sum++:
      |          ^
      |          ;
Language: C++

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

int main() {
  int s1s2s3;
  int k1 = s1s2s3 / 100;
  int k2 = (s1s2s3 - k1 * 100) / 10;
  int k3 = s1s2s3 - k1 * 100 - k2 *10
  cin >> s1s2s3;
  cout << k1 + k2 + k3 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'cin'
    9 |   cin >> s1s2s3;
      |   ^~~
Language: C++

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

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

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

#include<iostream>
using namespace std;

int main() {
  int isum=0;
  char ch;
  
  for(i=0;i<3;i++) {
    cin >> ch;
    if(ch == '1') sum++;
  }
  
  cout << sum << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i=0;i<3;i++) {
      |       ^
a.cc:10:19: error: 'sum' was not declared in this scope; did you mean 'isum'?
   10 |     if(ch == '1') sum++;
      |                   ^~~
      |                   isum
a.cc:13:11: error: 'sum' was not declared in this scope; did you mean 'isum'?
   13 |   cout << sum << endl;
      |           ^~~
      |           isum
Language: C++

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

int main() {
  int s1, s2, s3, n;
  cin >> s1 >> s2 >> s3;
  n = 0;
    if(S1 == 1){
      n + 1;
    }
    if(S2 == 1){
      n + 1;
    }
    if(S3 == 1){
      n + 1;
    }
  cout << n << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'S1' was not declared in this scope; did you mean 's1'?
    8 |     if(S1 == 1){
      |        ^~
      |        s1
a.cc:11:8: error: 'S2' was not declared in this scope; did you mean 's2'?
   11 |     if(S2 == 1){
      |        ^~
      |        s2
a.cc:14:8: error: 'S3' was not declared in this scope; did you mean 's3'?
   14 |     if(S3 == 1){
      |        ^~
      |        s3
Language: C++

#include "pch.h"
#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main()
{
	int n = 0;
	string S;
	cin >> S;

	for (int i = 0; i < 3; i++) {

		if (S[i] == '1') {
			n++;
		}
	}

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

#include "pch.h"
#include <iostream> 
#include <string>
using namespace std;
int main() {
	string number;
	int count;
	cin >> number;

	count = 0;

	for (int i = 0; i < 3; i++) {

		if (number.at(i) == '1') {
			count++;
		}
	}

	cout << count << endl;
}

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

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

int main() {

	string S;
	cin >> S;

	int ans = 0;

    for (int i = 0; i < S.size(); i++) {
			int S;
			cin >> S;
			if (S[i] == '1') {
				ans++;
			}
		}

	cout << ans << endl;



}



Compiler output:
a.cc: In function 'int main()':
a.cc:16:30: error: invalid types 'int[int]' for array subscript
   16 |                         if (S[i] == '1') {
      |                              ^
Language: C++


#include "pch.h"
#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main()
{
	string S;
	int ans = 0;

	cin >> S;
	for (int i = 0; i < S.size(); i++){
		
		if (S[i] == '1' ){
			ans++;
			
	}
	}
	cout << ans << endl;
}


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

#include "pch.h"

////////////////////////////////////////////////////////
////////////////////////////////////////////////////////
////////////////////////////////////////////////////////

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

int main()
{
	int n;
	cin >> n;
	cout << (n / 100) + (n % 10) + (n -((n/100)*100+(n%10))) << endl;

}



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

#include <iostream> #include <string> 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:1:21: warning: extra tokens at end of #include directive
    1 | #include <iostream> #include <string> using namespace std; int ans;
      |                     ^
a.cc:2:1: error: 'string' does not name a type; did you mean 'stdin'?
    2 | string s;
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |     cin >> s;
      |     ^~~
      |     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:4:12: error: 's' was not declared in this scope
    4 |     cin >> s;
      |            ^
a.cc:5:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
    5 |     if(s[0]=='1') ans++;
      |                   ^~~
      |                   abs
a.cc:6:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
    6 |     if(s[1]=='1') ans++;
      |                   ^~~
      |                   abs
a.cc:7:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
    7 |     if(s[2]=='1') ans++;
      |                   ^~~
      |                   abs
a.cc:8:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |     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:8:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |     cout << ans << endl;
      |             ^~~
      |             abs
a.cc:8:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    8 |     cout << ans << endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main() {
  int a,b,c, a_1;
  cin >> a;
  b = a % 10;
  c = c + b;
  a_1 = a - b / 10;
  b = (a - b / 10) % 10;
  c = c + b;
  b = ((a_1 - b) / 10) % 10;
  c = c + b;
  (a_1 - 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:1: error: expected primary-expression before '}' token
   15 | }
      | ^
a.cc:14:9: error: expected ')' before '}' token
   14 |   (a_1 -
      |   ~     ^
      |         )
   15 | }
      | ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int s; 
  cint >> s;
  cout << s%3 <<endl;
}

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

#include <bits/stdc++.h>
using namespace std;
int main() {
  int s 
  cint >> s;
  cout << s%3 <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: expected initializer before 'cint'
    5 |   cint >> s;
      |   ^~~~
a.cc:6:11: error: 's' was not declared in this scope
    6 |   cout << s%3 <<endl;
      |           ^
Language: C++

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


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

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    string s;
    int ans=0;
    cin>>s;
    if(s[0]==1){ans++}
    if(s[1]==1){ans++}
    if(s[2]==1){ans++}
    cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: expected ';' before '}' token
    8 |     if(s[0]==1){ans++}
      |                      ^
      |                      ;
a.cc:9:22: error: expected ';' before '}' token
    9 |     if(s[1]==1){ans++}
      |                      ^
      |                      ;
a.cc:10:22: error: expected ';' before '}' token
   10 |     if(s[2]==1){ans++}
      |                      ^
      |                      ;
Language: C++

#include <iostream>
#include <cstdlib>

int main () {
  int ans = 0;
  char s;
  for(int i = 0; i < 3; ++i){
    std::cin >> s;
    ans += std::atoi(s);
  }
  std::cout << ans << std::endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
    9 |     ans += std::atoi(s);
      |                      ^
      |                      |
      |                      char
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 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/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {int s;
    int hundred = s / 100
    int ten = (s - hundred * 100) /10
    int one = (s - hundred * 100 - ten * 10)
    cout << hundred + ten + one << endl;
}

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

#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
const double PI = 3.14159265358979323846;

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

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

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

int main() {
	int S;
	cin >> S;
	cout << s/100 + s/10%10 + s%100%10 <<endl;

}


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

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

int main(){

    int s_1, s_2, s_3;
    cin >> s_1 >> s_2 >> s_3;

    // １と書かれたマスの合計数　//

    cout << s_1 + s_2 + s_3 << endl;

    return 0;
}

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: 'length' was not declared in this scope
    9 |   for(int i=0; i < length(numbers); i++)
      |                    ^~~~~~