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

#include <stdio.h>
int main(void){
int a,b;
  int count=0;
char s[100];
  scanf("%s",s);
if(s[0]=='1'){count++}
  if(s[1]=='1'){count++}
  if(s[2]=='1'){count++}
  printf("%d",count);
}

Compiler output:
main.c: In function 'main':
main.c:7:22: error: expected ';' before '}' token
    7 | if(s[0]=='1'){count++}
      |                      ^
      |                      ;
main.c:8:24: error: expected ';' before '}' token
    8 |   if(s[1]=='1'){count++}
      |                        ^
      |                        ;
main.c:9:24: error: expected ';' before '}' token
    9 |   if(s[2]=='1'){count++}
      |                        ^
      |                        ;
Language: C++

#include <bits/stdc++.h>
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: In function 'int main()':
a.cc:8:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |   if(s[0] == "1"){
a.cc:11:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |   if(s[1] == "1"){
a.cc:14:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |   if(s[2] == "1"){
Language: C++

#include <bits/stdc++.h>
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: In function 'int main()':
a.cc:9:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |   if(s[0] == "1"){
a.cc:12:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   if(s[1] == "1"){
a.cc:15:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |   if(s[2] == "1"){
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int ans;
string s;

int main() {
  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:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |   if(s[0] == "1"){
a.cc:11:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |   if(s[1] == "1"){
a.cc:14:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |   if(s[2] == "1"){
Language: C++

#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define all(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define INF 2e9
signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    long long a,b,re1=0,h,w,count=0;
    string s;
    cin>>s;
    rep(i,3){
        if(s[i]=="1"){
            count++;
        }
    }
    cout<<count<<'\n';
    return(0);
}


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

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

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

}


Compiler output:
a.cc:9:1: error: expected unqualified-id before 'for'
    9 | for(int i=0;i<3;i++){
      | ^~~
a.cc:9:13: error: 'i' does not name a type
    9 | for(int i=0;i<3;i++){
      |             ^
a.cc:9:17: error: 'i' does not name a type
    9 | for(int i=0;i<3;i++){
      |                 ^
a.cc:14:1: error: 'cout' does not name a type
   14 | cout << count << endl;
      | ^~~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C++

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

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

}


Compiler output:
a.cc:9:1: error: expected unqualified-id before 'for'
    9 | for(int i=0;i<3;i++){
      | ^~~
a.cc:9:13: error: 'i' does not name a type
    9 | for(int i=0;i<3;i++){
      |             ^
a.cc:9:17: error: 'i' does not name a type
    9 | for(int i=0;i<3;i++){
      |                 ^
a.cc:14:1: error: 'cout' does not name a type
   14 | cout << count << endl;
      | ^~~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C++

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

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

}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:36: error: expected ';' before '}' token
    6 |         cin >> a[0] >> a[1] >> a[2]
      |                                    ^
      |                                    ;
    7 | }
      | ~                                   
a.cc: At global scope:
a.cc:9:1: error: expected unqualified-id before 'for'
    9 | for(int i=0;i<3;i++){
      | ^~~
a.cc:9:13: error: 'i' does not name a type
    9 | for(int i=0;i<3;i++){
      |             ^
a.cc:9:17: error: 'i' does not name a type
    9 | for(int i=0;i<3;i++){
      |                 ^
a.cc:14:1: error: 'cout' does not name a type
   14 | cout << count << endl;
      | ^~~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C++

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

int main(){
  int A = 0;
  cin >> A;
  cout <<(A%10)+((A%100)/10)+((A%1000)/100);
}

Compiler output:
a.cc: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 A = 0;
  cin >> A;
  cout << (A%10)+((A%100)/10)+((A%1000)/100);
}

Compiler output:
a.cc: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 a,s1,s2,s3
                cin>>s1>>s2>>s3
                a=100*s1+10*s2+s3
                cout<<a;
            }

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: expected initializer before 'cin'
    6 |                 cin>>s1>>s2>>s3
      |                 ^~~
Language: C++

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

int main() {
  string s;
  cin>>s;
  int a,b,c;
    a=s[0];
  b=s[1];
    c=[2];
  
  cout<<a+b+c<<endl;// ここにプログラムを追記
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: expected identifier before numeric constant
   10 |     c=[2];
      |        ^
a.cc: In lambda function:
a.cc:10:10: error: expected '{' before ';' token
   10 |     c=[2];
      |          ^
a.cc: In function 'int main()':
a.cc:10:7: error: invalid user-defined conversion from 'main()::<lambda()>' to 'int' [-fpermissive]
   10 |     c=[2];
      |       ^~~
a.cc:10:7: note: candidate is: 'constexpr main()::<lambda()>::operator void (*)()() const' (near match)
   10 |     c=[2];
      |       ^
a.cc:10:7: note:   no known conversion from 'void (*)()' to 'int'
Language: C++

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

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

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

#include <stdio.h>
 
int main(void) 
{
	int n;
	int num[200];
	int i,j;
	int flag = 0;
	int cnt = 0;
 
	scanf("%d", &n);
	for (i = 0; i < n; i++)
	{
		scanf_s("%d", &num[i]);
	}
 
	for (i = 0; i < n; i++)
	{
		for (j = 0; j < n; j++)
		{
			num[j] = num[j] / 2;
			if (num[j] % 2 == 1)
			{
				flag = 1;
			}
		}
		cnt++;
		if (flag == 1)
		{
			break;
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   14 |                 scanf_s("%d", &num[i]);
      |                 ^~~~~~~
      |                 scanf
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:7: error: expected unqualified-id before '=' token
    5 |   int = a,b,c;
      |       ^
a.cc:6:10: error: 'a' was not declared in this scope
    6 |   cin >> a >> b >> c;
      |          ^
a.cc:6:15: error: 'b' was not declared in this scope
    6 |   cin >> a >> b >> c;
      |               ^
a.cc:6:20: error: 'c' was not declared in this scope
    6 |   cin >> a >> b >> c;
      |                    ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:7: error: expected unqualified-id before '=' token
    5 |   int = a,b,c;
      |       ^
a.cc:6:10: error: 'a' was not declared in this scope
    6 |   cin >> a >> b >> c;
      |          ^
a.cc:6:15: error: 'b' was not declared in this scope
    6 |   cin >> a >> b >> c;
      |               ^
a.cc:6:20: error: 'c' was not declared in this scope
    6 |   cin >> a >> b >> c;
      |                    ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:7: error: expected unqualified-id before '=' token
    5 |   int = a;
      |       ^
a.cc:6:10: error: 'a' was not declared in this scope
    6 |   cin >> a;
      |          ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:7: error: expected unqualified-id before '=' token
    5 |   int = a, b, c;
      |       ^
a.cc:6:10: error: 'a' was not declared in this scope
    6 |   cin >> a >> b >> c;
      |          ^
a.cc:6:15: error: 'b' was not declared in this scope
    6 |   cin >> a >> b >> c;
      |               ^
a.cc:6:20: error: 'c' was not declared in this scope
    6 |   cin >> a >> b >> c;
      |                    ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:7: error: expected unqualified-id before '=' token
    5 |   int = a, b, c;
      |       ^
a.cc:6:10: error: 'a' was not declared in this scope
    6 |   cin >> a >> b >> c;
      |          ^
a.cc:6:15: error: 'b' was not declared in this scope
    6 |   cin >> a >> b >> c;
      |               ^
a.cc:6:20: error: 'c' was not declared in this scope
    6 |   cin >> a >> b >> c;
      |                    ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:7: error: expected unqualified-id before '=' token
    5 |   int = a, b, c;
      |       ^
a.cc:6:10: error: 'a' was not declared in this scope
    6 |   cin >> a >> b >> c;
      |          ^
a.cc:6:15: error: 'b' was not declared in this scope
    6 |   cin >> a >> b >> c;
      |               ^
a.cc:6:20: error: 'c' was not declared in this scope
    6 |   cin >> a >> b >> c;
      |                    ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: expected unqualified-id before '=' token
    5 |   string = a, b, c;
      |          ^
a.cc:6:10: error: 'a' was not declared in this scope
    6 |   cin >> a >> b >> c;
      |          ^
a.cc:6:15: error: 'b' was not declared in this scope
    6 |   cin >> a >> b >> c;
      |               ^
a.cc:6:20: error: 'c' was not declared in this scope
    6 |   cin >> a >> b >> c;
      |                    ^
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
  string s;
  cin >> s;
  cin.ignore();
  
  int count=0;
  for(int i = 0; i < 2; i++){
    if(s[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(s[i] == "1")
Language: C

#include <stdio.h>

int	main(void)
{
int	A[256];
int	N, c = 0;
int	tmp;
tmp = scanf("%d", &N);
if( tmp == EOF ) return -101;

if( N==0 || N>200 ) return 1;
for( int f= 0; f< N; ++f)
{
  tmp = scanf("%d", &A[ f ]);
  if( tmp == EOF ) return -102;
}

do
{
  int f= 0;
  for( f= 0; f< N; ++f)
  {
    if( A[ f ] %2 != 0 ) break;
    A[ f ] /= 2;
  }

  if( f != N )
  {
    printf("%d\n", c);
    return	0;
  } else {
	++c;
} while(-1);

return 10;
}

Compiler output:
main.c: In function 'main':
main.c:36:1: error: expected 'while' at end of input
   36 | }
      | ^
main.c:36:1: error: expected declaration or statement at end of input
Language: C

#include <stdio.h>

int	main(void)
{
int	A[256];
int	N, c = 0;
int	tmp;
tmp = scanf("%d", &N);
if( tmp == EOF ) return -101;

if( N==0 || N>200 ) return 1;
for( int f= 0; f< N; ++f)
{
  tmp = scanf("%d", &A[ f ]);
  if( tmp == EOF ) return -102;
}

do
{
  int f= 0;
  for( f= 0; f< N; ++f)
  {
    if( A[ f ] %2 != 0 ) break;
    A[ f ] /= 2;
  }

  if( f != N )
  {
    printf("%d\n", c);
    return	0;
  } else {
	++c;
} while(-1);



Compiler output:
main.c: In function 'main':
main.c:33:1: error: expected declaration or statement at end of input
   33 | } while(-1);
      | ^
main.c:33:1: error: expected declaration or statement at end of input
Language: C

#include <stdio.h>

int	main(void)
{
int	A[256];
int	N, c = 0;
int	tmp;
tmp = scanf("%d", &N);
if( tmp == EOF ) return -101;

if( N==0 || N>200 ) return 1;
for( int f= 0; f< N; ++f)
{
  tmp = scanf("%d", &A[ f ]);
  if( tmp == EOF ) return -102;
}

do
{
  int f= 0;
  for( f= 0; f< N; ++f)
  {
    if( A[ f ] %2 != 0 ) break;
    A[ f ] /= 2;
  }

  if( f != N )
  {
    printf("%d\n", c");
    return	0;
  } else {
	++c;
} while(-1);



Compiler output:
main.c: In function 'main':
main.c:29:21: warning: missing terminating " character
   29 |     printf("%d\n", c");
      |                     ^
main.c:29:21: error: missing terminating " character
   29 |     printf("%d\n", c");
      |                     ^~~
main.c:29:21: error: expected ')' before 'return'
   29 |     printf("%d\n", c");
      |           ~         ^
      |                     )
   30 |     return      0;
      |     ~~~~~~           
main.c:30:19: error: expected ';' before '}' token
   30 |     return      0;
      |                   ^
      |                   ;
   31 |   } else {
      |   ~                
main.c:33:1: error: expected declaration or statement at end of input
   33 | } while(-1);
      | ^
main.c:33:1: error: expected declaration or statement at end of input
Language: C++

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

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: expected ';' before '}' token
    9 |         ans += 1}
      |                 ^
      |                 ;
a.cc:11:17: error: expected ';' before '}' token
   11 |         ans += 1}
      |                 ^
      |                 ;
a.cc:13:17: error: expected ';' before '}' token
   13 |         ans += 1}
      |                 ^
      |                 ;
Language: C++

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

int main() {
  string a;
  cin >> a;
  cout << int(a.at(0)-'0') + int(s.at(1)-'0') + int(s.at(2)-'0') << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:34: error: 's' was not declared in this scope
    7 |   cout << int(a.at(0)-'0') + int(s.at(1)-'0') + int(s.at(2)-'0') << endl;
      |                                  ^
Language: C++

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

int main() {
  string s;
  cin >> s;
  cout << int(a.at(0)-'0') + int(s.at(1)-'0') + int(s.at(2)-'0') << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: 'a' was not declared in this scope
    7 |   cout << int(a.at(0)-'0') + int(s.at(1)-'0') + int(s.at(2)-'0') << endl;
      |               ^
Language: C++

# include <bits/stdc++.h>
# define INF 1e9
using namespace std;

int main(){

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

  cout << ans << endl;

}


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

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

int main() {
 int s1s2s3 , x ;
 cin >> s1s2s3 ;
  x = s1s2s3 % 6 ;
  4 = 1 ; 5 = 2 ;
  cout << x << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: lvalue required as left operand of assignment
    8 |   4 = 1 ; 5 = 2 ;
      |   ^
a.cc:8:11: error: lvalue required as left operand of assignment
    8 |   4 = 1 ; 5 = 2 ;
      |           ^
Language: C++

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

int main() {
 int abc ;

  
 cin >> a >> b >> c ;
  
  cout << a + b + c ;
}




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

#include <iostream>
#include <fstream>
#include <stdio.h>
using namespace std;

int main(void)
{
    //string a,b;
    int a,b,c,d,i=0;
    char a,b='.';
    //cin>>a;
    while(1)
    {
        a=getchar();
        if(a=='\n'||a==EOF) break;
        if(a=='1') i++;
    }
    cout<<i;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: conflicting declaration 'char a'
   10 |     char a,b='.';
      |          ^
a.cc:9:9: note: previous declaration as 'int a'
    9 |     int a,b,c,d,i=0;
      |         ^
a.cc:10:12: error: conflicting declaration 'char b'
   10 |     char a,b='.';
      |            ^
a.cc:9:11: note: previous declaration as 'int b'
    9 |     int a,b,c,d,i=0;
      |           ^
Language: C++

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

int main() {
 int s1s2s3 , x ;
 cin >> s1s2s3 ;
  x = s1s2s3 % 3
 cout << x << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: expected ';' before 'cout'
    7 |   x = s1s2s3 % 3
      |                 ^
      |                 ;
    8 |  cout << x << endl;
      |  ~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: invalid types 'char[int]' for array subscript
   12 |   if(S[0] == 1) sum += 1;
      |       ^
a.cc:13:7: error: invalid types 'char[int]' for array subscript
   13 |   if(S[1] == 1) sum += 1;
      |       ^
a.cc:14:7: error: invalid types 'char[int]' for array subscript
   14 |   if(S[2] == 1) sum += 1;
      |       ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:7: error: invalid types 'int[int]' for array subscript
   12 |   if(S[0] == 1) sum += 1;
      |       ^
a.cc:13:7: error: invalid types 'int[int]' for array subscript
   13 |   if(S[1] == 1) sum += 1;
      |       ^
a.cc:14:7: error: invalid types 'int[int]' for array subscript
   14 |   if(S[2] == 1) sum += 1;
      |       ^
Language: C

#include <stdio.h>

int main()
{
	unsigned int a[200] = {};
	unsigned int n = 0;
	unsigned int i = 0;
	int count=0;
	bool EndFlag = false;

	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &a[i]);
	}
	for (count = 0;false == EndFlag; ) {
		for (i = 0; i < n; i++) {
			if (0 ==(a[i] % 2)) {
				a[i] = a[i] / 2;
			}
			else {
				EndFlag = true;
			}
		}
		if(false == EndFlag)	count++;
	}
	printf("%d\n", count);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:9: error: unknown type name 'bool'
    9 |         bool EndFlag = false;
      |         ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c:9:24: error: 'false' undeclared (first use in this function)
    9 |         bool EndFlag = false;
      |                        ^~~~~
main.c:9:24: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:9:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:43: error: 'true' undeclared (first use in this function)
   21 |                                 EndFlag = true;
      |                                           ^~~~
main.c:21:43: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C++

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

string s;
int ans;

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
    8 |     if(s.at(i)="1"){
      |                ^~~
      |                |
      |                const char*
Language: C++

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

int main () {
  
  string s;
  cin >> s;
  
  int A=0;
  
  if(s.at(0)==1){
    A++;
  }
    if(s.at(1)==1){
    A++;
  }  
    if(s.at(2)==1){
    A++;
  }
  
  cout << A <<endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string s;
      |   ^~~~~~
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin >> s;
      |   ^~~
a.cc:7:10: error: 's' was not declared in this scope
    7 |   cin >> s;
      |          ^
a.cc:21:3: error: 'cout' was not declared in this scope
   21 |   cout << A <<endl;
      |   ^~~~
a.cc:21:15: error: 'endl' was not declared in this scope
   21 |   cout << A <<endl;
      |               ^~~~
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; string s; int main(){ cin >> s; if(s[0]=='1') ans++; if(s[1]=='1') ans++; if(s[2]=='1') ans++; cout << ans << endl;
      |                     ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

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

int main () {

  int S,;
  cin >> S;
   
   int sum = 0;
    for(int i =0;i > S.size();i++){
      if(S.at(i)==1){
        sum++;
      }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: expected unqualified-id before ';' token
    6 |   int S,;
      |         ^
a.cc:10:24: error: request for member 'size' in 'S', which is of non-class type 'int'
   10 |     for(int i =0;i > S.size();i++){
      |                        ^~~~
a.cc:11:12: error: request for member 'at' in 'S', which is of non-class type 'int'
   11 |       if(S.at(i)==1){
      |            ^~
Language: C++

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

int main () {

  int S;
  cin >> S;
   
   int sum = 0;
    for(int i =0;i > S.size();i++){
      if(S.at(i)==1){
        sum++;
      }
    }


Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: request for member 'size' in 'S', which is of non-class type 'int'
   10 |     for(int i =0;i > S.size();i++){
      |                        ^~~~
a.cc:11:12: error: request for member 'at' in 'S', which is of non-class type 'int'
   11 |       if(S.at(i)==1){
      |            ^~
a.cc:14:6: error: expected '}' at end of input
   14 |     }
      |      ^
a.cc:4:13: note: to match this '{'
    4 | int main () {
      |             ^
Language: C++


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

int main () {

  int S,;
  cin >> S;
   
   int sum = 0;
    for(int i =0;i > S.size();i++){
      if(S.at(i)==1){
        sum++;
      }
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: expected unqualified-id before ';' token
    7 |   int S,;
      |         ^
a.cc:11:24: error: request for member 'size' in 'S', which is of non-class type 'int'
   11 |     for(int i =0;i > S.size();i++){
      |                        ^~~~
a.cc:12:12: error: request for member 'at' in 'S', which is of non-class type 'int'
   12 |       if(S.at(i)==1){
      |            ^~
a.cc:15:6: error: expected '}' at end of input
   15 |     }
      |      ^
a.cc:5:13: note: to match this '{'
    5 | int main () {
      |             ^
Language: C++

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

int main() {
  
  int L;
  
  cin>>L;
  
  int M=L%100;
  int N=M%10
  int La=L/100
  int Ma=M/10
  int Na=N/1
  
  cout << La+Ma+Na << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: expected ',' or ';' before 'int'
   12 |   int La=L/100
      |   ^~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: expected ';' before 'cout'
   11 |   c=(c-a*100-b*10)
      |                   ^
      |                   ;
   12 |   cout << a+b+c << endl;
      |   ~~~~
Language: C

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <time.h>

#define REP(i,n) for(i=0;i<n;i++)
#define ll long long

int main(void){
    int i;
    char s[3];
    REP(i,3){
        scanf("%c",&s[i]);
    }
    
    int ctr=0;
    if s[0]=='1' ctr++;
    if s[1]=='1' ctr++;
    if s[2]=='1' ctr++;

    printf("%d",ctr);
    
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:8: error: expected '(' before 's'
   17 |     if s[0]=='1' ctr++;
      |        ^
      |        (
main.c:18:8: error: expected '(' before 's'
   18 |     if s[1]=='1' ctr++;
      |        ^
      |        (
main.c:19:8: error: expected '(' before 's'
   19 |     if s[2]=='1' ctr++;
      |        ^
      |        (
Language: C

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <time.h>

#define REP(i,n) for(i=0;i<n;i++)
#define ll long long

int main(void){
    char s[3];
    REP(int i,3){
        scanf("%c",s[i]);
    }
    
    int ctr=0;
    if s[0]=='1' ctr++;
    if s[1]=='1' ctr++;
    if s[2]=='1' ctr++;

    printf("%d",ctr);
    
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:9: error: expected expression before 'int'
   11 |     REP(int i,3){
      |         ^~~
main.c:6:26: note: in definition of macro 'REP'
    6 | #define REP(i,n) for(i=0;i<n;i++)
      |                          ^
main.c:11:9: error: expected expression before 'int'
   11 |     REP(int i,3){
      |         ^~~
main.c:6:30: note: in definition of macro 'REP'
    6 | #define REP(i,n) for(i=0;i<n;i++)
      |                              ^
main.c:16:8: error: expected '(' before 's'
   16 |     if s[0]=='1' ctr++;
      |        ^
      |        (
main.c:17:8: error: expected '(' before 's'
   17 |     if s[1]=='1' ctr++;
      |        ^
      |        (
main.c:18:8: error: expected '(' before 's'
   18 |     if s[2]=='1' ctr++;
      |        ^
      |        (
Language: C

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <time.h>

#define REP(i,n) for(i=0;i<n;i++)
#define ll long long

int main(void){
    char s[3];
    REP(int i,3){
        scanf("%c",s[i]);
    }
    
    int ctr=0;
    if s[0]==1 ctr++;
    if s[1]==1 ctr++;
    if s[2]==1 ctr++;

    printf("%d",ctr);
    
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:9: error: expected expression before 'int'
   11 |     REP(int i,3){
      |         ^~~
main.c:6:26: note: in definition of macro 'REP'
    6 | #define REP(i,n) for(i=0;i<n;i++)
      |                          ^
main.c:11:9: error: expected expression before 'int'
   11 |     REP(int i,3){
      |         ^~~
main.c:6:30: note: in definition of macro 'REP'
    6 | #define REP(i,n) for(i=0;i<n;i++)
      |                              ^
main.c:16:8: error: expected '(' before 's'
   16 |     if s[0]==1 ctr++;
      |        ^
      |        (
main.c:17:8: error: expected '(' before 's'
   17 |     if s[1]==1 ctr++;
      |        ^
      |        (
main.c:18:8: error: expected '(' before 's'
   18 |     if s[2]==1 ctr++;
      |        ^
      |        (
Language: C++

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

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

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

#include <iostream>
using namespace std;

int main() {
  int S, count = 0;
  cin >> S;
  for (i = 0; i < S.size(); i++) {
    if (S.at(i) == 1){
      count += 1;
    }
  }
  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 < S.size(); i++) {
      |        ^
a.cc:7:21: error: request for member 'size' in 'S', which is of non-class type 'int'
    7 |   for (i = 0; i < S.size(); i++) {
      |                     ^~~~
a.cc:8:11: error: request for member 'at' in 'S', which is of non-class type 'int'
    8 |     if (S.at(i) == 1){
      |           ^~
Language: C++

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

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

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

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

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


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected ',' or ';' before 'int'
    7 |   int c=ceil((a-b*100)/10)
      |   ^~~
a.cc:10:15: error: 'c' was not declared in this scope
   10 |   cout << a+b+c <<endl;
      |               ^
Language: C++

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

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


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

    #include <stdio.h>
    #include <string>
        #include <iostream>
        #include <cstdio>
        using namespace std;
        int main(){
          char m[];
          int d = 0;
          cin >> m;
          if(m[0] == '1') d += 1;
          if(m[1] == '1') d += 1;
          if(m[2] == '1') d += 1;
          cout << d << endl;
          return 0;
        }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: storage size of 'm' isn't known
    7 |           char m[];
      |                ^
Language: C++

#include <iostream>
#include <cstdio>
using namespace std;
int main(){
  char m[4];
  int d = 0;
  cin >> m;
  if(m[0] == "1") d += 1;
  if(m[1] == "1") d += 1;
  if(m[2] == "1") d += 1;
  cout << d << endl;
  return 0;
}

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

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

int main() {
  int A, B;
  cin >> A;
  B = A / 111
  cout << A % 3 + B * 3;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: expected ';' before 'cout'
    7 |   B = A / 111
      |              ^
      |              ;
    8 |   cout << A % 3 + B * 3;
      |   ~~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int ans=0;
char s;
int main(){
  cin>>s;
  for(int i=0;i<3;i++){
    if(a=='1') ans++;
  }
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: 'a' was not declared in this scope
   11 |     if(a=='1') ans++;
      |        ^
Language: C++

#include <iostream>
using namespace std;

int main(){
  int s;
  cin>>a;
  int d;
  d=a%10;
  int e;
  e=a/100;
  int f;
  f=(a-(e*100))/10;
  cout<<d+e+f<<endl;
}

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

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

    cin >> s ;
    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:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    8 |     if(s[0]=="1") cnt++;
a.cc:9:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |     if(s[1]=="1") cnt++;
a.cc:10:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if(s[2]=="1") cnt++;
Language: C++

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

    cin >> s ;
    if(c[0]=="1") cnt++;
    if(c[1]=="1") cnt++;
    if(c[2]=="1") cnt++;

    cout << cnt << endl;
}

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

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

int main() {
  int ans = 0;
  string s;
  std::cin >> s;
  if (s[0] == "1") ans++;
  if (s[1] == "1") ans++;
  if (s[2] == "1") ans++;
  std::cout << ans << '\n';
}


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(){
	stirng s;
	cin >> s;
	int n = 0;
	if(s[0] == 1) n++;
	if(s[1] == 1) n++;
	if(s[2] == 1) n++;
	
	cout << n << endl;
}


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

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

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

#include<iostream>
using namespace std;

int main(){
	int s;
	int count = 0;
	cin >> s;
	wihle(s){
		if(s%2) count++;
		s /= 2;
	}
	cout << count;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'wihle' was not declared in this scope
    8 |         wihle(s){
      |         ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstring>
#define rep(i, N) for (int i = 0; i < (int)N; i++)
using namespace std;
typedef long long ll;
const ll LLINF = 9223372036854775807;
const int MOD = 1000000007;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:37: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |   int result = 0; rep(i, 3) if (S[i]=="1") result++;
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: expected ';' before '}' token
    9 | if(s[i]=='1'){cnt++}
      |                    ^
      |                    ;
Language: C++

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

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

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

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

string s;

int main(){
cin >> s;

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

cout << s << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: 'i' was not declared in this scope
   10 |   if(s[i]=='1')++s;
      |        ^
a.cc:10:16: error: no match for 'operator++' (operand type is 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   10 |   if(s[i]=='1')++s;
      |                ^~~
Language: C++

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

strings s;

int main(){
cin >> s;

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

cout << s << endl;
}

Compiler output:
a.cc:4:1: error: 'strings' does not name a type; did you mean 'stdin'?
    4 | strings s;
      | ^~~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:7:8: error: 's' was not declared in this scope
    7 | cin >> s;
      |        ^
a.cc:10:8: error: 'i' was not declared in this scope
   10 |   if(s[i]=='1')++s;
      |        ^
Language: C++

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

int main(){
cin >> s;

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

cout << s << endl;
}

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

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

int main(){
cin >> s;

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

cout << s << endl;
}

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

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

int main(){
cin >> s;

  for (int i = 0; i < N; i++);
  if(s[i]=='1')++s;

cout << s << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: 's' was not declared in this scope
    5 | cin >> s;
      |        ^
a.cc:7:23: error: 'N' was not declared in this scope
    7 |   for (int i = 0; i < N; i++);
      |                       ^
a.cc:8:8: error: 'i' was not declared in this scope
    8 |   if(s[i]=='1')++s;
      |        ^
Language: C++

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

int main(){
cin >> s;

  for (int i = 0; i < N; i++);
  if(s[i]=='1');

cout << s << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: 's' was not declared in this scope
    5 | cin >> s;
      |        ^
a.cc:7:23: error: 'N' was not declared in this scope
    7 |   for (int i = 0; i < N; i++);
      |                       ^
a.cc:8:8: error: 'i' was not declared in this scope
    8 |   if(s[i]=='1');
      |        ^
Language: C++

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

int main(){

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: 's1' was not declared in this scope; did you mean 'y1'?
    7 | cin >>s1>>s2>>s3;
      |       ^~
      |       y1
a.cc:7:11: error: 's2' was not declared in this scope
    7 | cin >>s1>>s2>>s3;
      |           ^~
a.cc:7:15: error: 's3' was not declared in this scope
    7 | cin >>s1>>s2>>s3;
      |               ^~
Language: C++

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

  int ans = 0;
  char a, b, c;
  
  char a = s.at(0);
  char b = s.at(1);
  char c = s.at(2);
  
  if (a == 1) ans++;
  if (b == 1) ans++;
  if (c == 1) ans++;
  
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:8: error: redeclaration of 'char a'
   13 |   char a = s.at(0);
      |        ^
a.cc:11:8: note: 'char a' previously declared here
   11 |   char a, b, c;
      |        ^
a.cc:14:8: error: redeclaration of 'char b'
   14 |   char b = s.at(1);
      |        ^
a.cc:11:11: note: 'char b' previously declared here
   11 |   char a, b, c;
      |           ^
a.cc:15:8: error: redeclaration of 'char c'
   15 |   char c = s.at(2);
      |        ^
a.cc:11:14: note: 'char c' previously declared here
   11 |   char a, b, c;
      |              ^
Language: C++

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

  int ans = 0;
  
  if (s.at(1) == "1") ans++;
  if (s.at(2) == "1") ans++;
  if (s.at(3) == "1") ans++;
  
  cout << ans << endl;
}

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

#include <bits/stdc++.h>
#include <iostream>
#include <string>
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:12:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   12 |   if (s.at(0) == "1") ans++;
      |       ~~~~~~~~^~~~~~
a.cc:13:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   13 |   if (s.at(1) == "1") ans++;
      |       ~~~~~~~~^~~~~~
a.cc:14:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |   if (s.at(2) == "1") ans++;
      |       ~~~~~~~~^~~~~~
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <string>
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:12:11: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   12 |   if (s.at[0] == "1") ans++;
      |           ^
a.cc:13:11: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   13 |   if (s.at[1] == "1") ans++;
      |           ^
a.cc:14:11: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   14 |   if (s.at[2] == "1") ans++;
      |           ^