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

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


int main()
{
	string str;
	int q;
	cin >> str >> q;

	for (int i = 0;i < q;i++) {
		string order;
		int a, b;
		cin >> order >> a >> b;

		if (order == "replace") {
			string p;
			cin >> p;

			str = str.replace(a, b-a+1, p);
		}
		else if (order == "reverse") {
			string rev = str.substr(a, b-a+1);
			
			reverse(rev.begin(), rev.end());
			str = str.replace(a, b-a+1, rev);
		}
		else {
			cout << str.substr(a, b - a + 1) << endl;
		}
	}

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:26:25: error: 'reverse' was not declared in this scope
   26 |                         reverse(rev.begin(), rev.end());
      |                         ^~~~~~~
Language: C++

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

int main(){
string s,o,w;
int n,a,b;
cin>>s>>n;
while(cin>>o>>a>>b){

if(o=="print"){
cout<<o.substr(a,b-a)<<endl;
}

if(o=="reverse"){
for(int i=a,j=b;i<j;i++,j--){
swap(o[i],o[j]);
}}

if(o=="replace"){
cin>>w;
o=o.substr(0,a)+w+o.substr(b)
}


}

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:30: error: expected ';' before '}' token
   21 | o=o.substr(0,a)+w+o.substr(b)
      |                              ^
      |                              ;
   22 | }
      | ~
Language: C++

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

int main(){
string s,o,w;
int n,a,b;
cin>>s>>n;
for(x=0;x<n;x++){

cin>>o>>a>>b;

if(o=="print"){
cout<<s.substr(a,b-a)<<endl;
}

if(o=="reverse"){
for(int i=a,j=b;i<j;i++,j--){
swap(s[i],s[j]);
}}

if(o=="replace"){
cin>>w;
s=s.substr(0,a)+w+s.substr(b);
}


}

return 0;
}


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

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

string str, rep, cmd;
int main(){
    int num, beg, end;
    cin >> str >> num;
    for(int i = 0; i < num; i++){
        cin >> cmd;
        switch(cmd){
            case "print":
                cin >> beg >> end;
                for(int j = beg; j <= end; j++){
                    cout << str[j];
                }
                cout << endl;
                break;
            case "reverse":
                cin >> beg >> end;
                reverse(str.begin()+beg, str.begin()+end)
                break;
            case "replace":
                cin >> beg >> end >> rep;
                str.replace(beg, rep.size(), rep);
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: switch quantity not an integer
   11 |         switch(cmd){
      |                ^~~
a.cc:21:17: error: 'reverse' was not declared in this scope
   21 |                 reverse(str.begin()+beg, str.begin()+end)
      |                 ^~~~~~~
Language: C++

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

string str, rep, cmd;
int main(){
    int num, beg, end;
    cin >> str >> num;
    for(int i = 0; i < num; i++){
        cin >> cmd;
        switch(cmd){
            case "print":
                cin >> beg >> end;
                for(int j = beg; j <= end; j++){
                    cout << str[j];
                }
                cout << endl;
                break;
            case "reverse":
                cin >> beg >> end;
                reverse(str.begin()+beg, str.begin()+end)
                break;
            case "replace":
                cin >> beg >> end >> rep;
                str.replace(beg, rep.size(), rep);
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: switch quantity not an integer
   12 |         switch(cmd){
      |                ^~~
a.cc:22:58: error: expected ';' before 'break'
   22 |                 reverse(str.begin()+beg, str.begin()+end)
      |                                                          ^
      |                                                          ;
   23 |                 break;
      |                 ~~~~~
Language: C++

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

string str, rep, cmd;
int main(){
    int num, beg, end;
    cin >> str >> num;
    for(int i = 0; i < num; i++){
        cin >> cmd;
        switch(cmd){
            case "print":
                cin >> beg >> end;
                for(int j = beg; j <= end; j++){
                    cout << str[j];
                }
                cout << endl;
                break;
            case "reverse":
                cin >> beg >> end;
                reverse(str.begin()+beg, str.begin()+end);
                break;
            case "replace":
                cin >> beg >> end >> rep;
                str.replace(beg, rep.size(), rep);
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: switch quantity not an integer
   12 |         switch(cmd){
      |                ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
string Replace(string s,int a,int b,string t){
  for(int i=a; i<=b; i++){
        s[i]=t[i-a];
  }
  return s;
}

string Reverse(string s,int a,int b){
  int i=a,j=b;
  while(i<j){
        swap(s[i],s[j]);
        i++;
        j--;
  }
  return s;
}

void print(string s,int a,int b){
  for(int i=a; i<=b; i++){
        cout << endl;
  }
}

int main(){
  string str,command,t;
  cin >> str;
  int q,a,b;
  cin >> q;
  for(int i=0; i<q; i++){
        cin >> command;
        cin >> a >> b;
        if(command=="replace"){
          cin >> t;
          str=Replace(str,a,b,t);
        } else if(command=="reverse"){
          str = Reverse(str,a,b);
        } else if(command == "print"){
          Print(str,a,b);
        }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:11: error: 'Print' was not declared in this scope; did you mean 'print'?
   40 |           Print(str,a,b);
      |           ^~~~~
      |           print
Language: C++

#include<bits/stdc++.h>
using namespace std;
string Replace(string s,int a,int b,string t){
  for(int i=a; i<=b; i++){
        s[i]=t[i-a];
  }
  return s;
}

string Reverse(string s,int a,int b){
  int i=a,j=b;
  while(i<j){
        swap(s[i],s[j]);
        i++;
        j--;
  }
  return s;
}

void print(string s,int a,int b){
  for(int i=a; i<=b; i++){
        cout << s[i];
  }
  cout << endl;
}

int main(){
  string str,command,t;
  cin >> str;
  int q,a,b;
  cin >> q;
  for(int i=0; i<q; i++){
        cin >> command;
        cin >> a >> b;
        if(command=="replace"){
          cin >> t;
          str=Replace(str,a,b,t);
        } else if(command=="reverse"){
          str = Reverse(str,a,b);
        } else if(command == "print"){
          Print(str,a,b);
        }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:11: error: 'Print' was not declared in this scope; did you mean 'print'?
   41 |           Print(str,a,b);
      |           ^~~~~
      |           print
Language: C++

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

string toUpper(string s){
    string t = s;
    for(int i = 0; i < s.size(); i++){
        t[i] = toupper(s[i]);
    }
    return t;
}

int main(){
    string str, order, p;
    int n = 0, a = 0, b = 0;
    cin >>str >>n;
    for(int i =0; i<n; i++){
        cin >>order >>a >>b;
        if(order == "print") cout << str.substr(a, b) << endl;
        else if(order == "reverse") reverse(str[a], str[b]);
        else if(order == "replace"){
            cin >>p;
            str.replace(a, b, p);
        }
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:37: error: 'reverse' was not declared in this scope
   21 |         else if(order == "reverse") reverse(str[a], str[b]);
      |                                     ^~~~~~~
Language: C++

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        int n = sc.nextInt();
        String ch ="";
        int t,f;


        for(int i=0;i<n;i++){
            String test = sc.next();

            if(test.equals("replace")){
            	t=sc.nextInt();
            	f=sc.nextInt();
            	ch=sc.next();
            	str = str.replaceFirst(str.substring(t,f+1),ch);

            }
            else if(test.equals("reverse")){
            	t=sc.nextInt();
            	f=sc.nextInt();
            	char rev[]= str.substring(t,f+1).toCharArray();
            	char rev2[] = new char[rev.length];
            	for(int j=0;j<rev.length;j++){
            		rev2[j]=rev[rev.length-1-j];
            	}
            	str=str.replaceFirst(str.substring(t,f+1),String.valueOf(rev2));


            }else if(test.equals("print")){
            	t=sc.nextInt();
            	f=sc.nextInt();
            	System.out.println(str.substring(t,f+1));

            }else{
            	System.out.println("EEE");
            }



        }
        sc.close();
    }

}



Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
    2 | public class Main{
      | ^~~~~~
Language: C++

import java.util.Scanner;
public class s9{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        int n = sc.nextInt();
        String ch ="";
        int t,f;


        for(int i=0;i<n;i++){
            String test = sc.next();

            if(test.equals("replace")){
            	t=sc.nextInt();
            	f=sc.nextInt();
            	ch=sc.next();
            	str = str.replaceFirst(str.substring(t,f+1),ch);

            }
            else if(test.equals("reverse")){
            	t=sc.nextInt();
            	f=sc.nextInt();
            	char rev[]= str.substring(t,f+1).toCharArray();
            	char rev2[] = new char[rev.length];
            	for(int j=0;j<rev.length;j++){
            		rev2[j]=rev[rev.length-1-j];
            	}
            	str=str.replaceFirst(str.substring(t,f+1),String.valueOf(rev2));


            }else if(test.equals("print")){
            	t=sc.nextInt();
            	f=sc.nextInt();
            	System.out.println(str.substring(t,f+1));

            }else{
            	System.out.println("EEE");
            }



        }
        sc.close();
    }

}



Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
    2 | public class s9{
      | ^~~~~~
Language: C++



#include <bits/stdc++.h> using namespace std; void Print(vector<string>& svec, string& str, int i, int j) { svec.push_back(string(str.begin()+i, str.begin()+j+1)); } void Replace(string& str, string target, int i, int j) { str.replace(str.begin()+i, str.begin()+j+1, target); } void Reverse(string& str, int i, int j) { reverse(str.begin()+i, str.begin()+j+1); } int main(int argc, char* argv[]) { string origin; int lines; vector<string> strvec; cin >> origin >> lines; for (int i = 0; i < lines; i++) { string operation; cin >> operation; if(operation=="replace") { int i,j; string tmpstr; cin >> i >> j >> tmpstr; Replace(origin, tmpstr, i, j); }else if(operation=="reverse") { int i,j; cin >> i >> j; Reverse(origin, i, j); }else if(operation=="print") { int i,j; cin >> i >> j; Print(strvec, origin, i, j); } } for (auto var : strvec) { cout << var << endl; } return 0; } 


Compile Error Logs: 

 

Status 
Judge: 16/16 C++11 CPU: 00:00 sec Memory: 3196 KB Length: 1136 B 2018-05-15 14:49 
Results for testcases 
 



Compiler output:
a.cc:3:26: warning: extra tokens at end of #include directive
    3 | #include <bits/stdc++.h> using namespace std; void Print(vector<string>& svec, string& str, int i, int j) { svec.push_back(string(str.begin()+i, str.begin()+j+1)); } void Replace(string& str, string target, int i, int j) { str.replace(str.begin()+i, str.begin()+j+1, target); } void Reverse(string& str, int i, int j) { reverse(str.begin()+i, str.begin()+j+1); } int main(int argc, char* argv[]) { string origin; int lines; vector<string> strvec; cin >> origin >> lines; for (int i = 0; i < lines; i++) { string operation; cin >> operation; if(operation=="replace") { int i,j; string tmpstr; cin >> i >> j >> tmpstr; Replace(origin, tmpstr, i, j); }else if(operation=="reverse") { int i,j; cin >> i >> j; Reverse(origin, i, j); }else if(operation=="print") { int i,j; cin >> i >> j; Print(strvec, origin, i, j); } } for (auto var : strvec) { cout << var << endl; } return 0; }
      |                          ^~~~~
a.cc:5:1: error: 'Compile' does not name a type
    5 | 
      | ^
Language: C++

#include <bits/stdc++.h> using namespace std; void Print(vector<string>& svec, string& str, int i, int j) { svec.push_back(string(str.begin()+i, str.begin()+j+1)); } void Replace(string& str, string target, int i, int j) { str.replace(str.begin()+i, str.begin()+j+1, target); } void Reverse(string& str, int i, int j) { reverse(str.begin()+i, str.begin()+j+1); } int main(int argc, char* argv[]) { string origin; int lines; vector<string> strvec; cin >> origin >> lines; for (int i = 0; i < lines; i++) { string operation; cin >> operation; if(operation=="replace") { int i,j; string tmpstr; cin >> i >> j >> tmpstr; Replace(origin, tmpstr, i, j); }else if(operation=="reverse") { int i,j; cin >> i >> j; Reverse(origin, i, j); }else if(operation=="print") { int i,j; cin >> i >> j; Print(strvec, origin, i, j); } } for (auto var : strvec) { cout << var << endl; } return 0; } 


Compiler output:
a.cc:1:26: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++.h> using namespace std; void Print(vector<string>& svec, string& str, int i, int j) { svec.push_back(string(str.begin()+i, str.begin()+j+1)); } void Replace(string& str, string target, int i, int j) { str.replace(str.begin()+i, str.begin()+j+1, target); } void Reverse(string& str, int i, int j) { reverse(str.begin()+i, str.begin()+j+1); } int main(int argc, char* argv[]) { string origin; int lines; vector<string> strvec; cin >> origin >> lines; for (int i = 0; i < lines; i++) { string operation; cin >> operation; if(operation=="replace") { int i,j; string tmpstr; cin >> i >> j >> tmpstr; Replace(origin, tmpstr, i, j); }else if(operation=="reverse") { int i,j; cin >> i >> j; Reverse(origin, i, j); }else if(operation=="print") { int i,j; cin >> i >> j; Print(strvec, origin, i, j); } } for (auto var : strvec) { cout << var << endl; } return 0; }
      |                          ^~~~~
/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 <cstdio>
#include <string>

int main()
{
    char c[1001], rc[1001], s[111];
    int a, b, n;
    scanf("%s", c);
    scanf("%d", &n);
    char w[111];
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < 111; j++)
        {
            s[j] = 0;
        }
        scanf("%s ", s);
        if (strcmp(s, "print ") == 0)
        {
            scanf("%d %d", &a, &b);
            for (int j = a; j <= b; j++)
            {
                printf("%c", c[j]);
            }
            printf("1");
            printf("\n");
        }
        else if (strcmp(s, "replace") == 0)
        {
            scanf("%d %d %s", &a, &b, rc);
            int p = 0;
            for (int j = a; j <= b; j++)
            {
                c[j] = rc[p];
                p++;
            }
        }
        else
        {
            scanf("%d %d", &a, &b);
            int p = b;
            strcpy(rc, c);
            for (int j = a; j <= b; j++)
            {
                c[j] = rc[p];
                p--;
            }
        }
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:13: error: 'strcmp' was not declared in this scope
   18 |         if (strcmp(s, "print ") == 0)
      |             ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <string>
  +++ |+#include <cstring>
    3 | 
a.cc:42:13: error: 'strcpy' was not declared in this scope
   42 |             strcpy(rc, c);
      |             ^~~~~~
a.cc:42:13: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <cstdio>
#include <string>

int main()
{
    char c[1001], rc[1001], s[111];
    int a, b, n;
    scanf("%s", c);
    scanf("%d", &n);
    char w[111];
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < 111; j++)
        {
            s[j] = 0;
        }
        scanf("%s ", s);
        if (strcmp(s, "print") == 0)
        {
            scanf("%d %d", &a, &b);
            for (int i = a; i <= b; i++)
            {
                printf("%c", c[i]);
            }
            printf("\n");
        }
        else if (strcmp(s, "replace") == 0)
        {
            scanf("%d %d %s", &a, &b, rc);
            int j = 0;
            for (int i = a; i <= b; i++)
            {
                c[i] = rc[j];
                j++;
            }

            printf("%s", c);
        }
        else
        {
            scanf("%d %d", &a, &b);
            int j = b;
            strcpy(rc, c);
            for (int i = a; i <= b; i++)
            {
                c[i] = rc[j];
                j--;
            }
        }
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:13: error: 'strcmp' was not declared in this scope
   18 |         if (strcmp(s, "print") == 0)
      |             ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <string>
  +++ |+#include <cstring>
    3 | 
a.cc:43:13: error: 'strcpy' was not declared in this scope
   43 |             strcpy(rc, c);
      |             ^~~~~~
a.cc:43:13: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <cstdio>
#include <string>

int main()
{
    char c[1001], rc[1001], s[111];
    int a, b, n;
    scanf("%s", c);
    scanf("%d", &n);
    char w[111];
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < 111; j++)
        {
            s[j] = 0;
        }
        scanf("%s ", s);
        if (strcmp(s, "print") == 0)
        {
            scanf("%d %d", &a, &b);
            for (int i = a; i <= b; i++)
            {
                printf("%c", c[i]);
            }
            printf("\n");
        }
        else if (strcmp(s, "replace") == 0)
        {
            scanf("%d %d %s", &a, &b, rc);
            int j = 0;
            for (int i = a; i <= b; i++)
            {
                c[i] = rc[j];
                j++;
            }
        }
        else
        {
            scanf("%d %d", &a, &b);
            int j = b;
            strcpy(rc, c);
            for (int i = a; i <= b; i++)
            {
                c[i] = rc[j];
                j--;
            }
        }
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:13: error: 'strcmp' was not declared in this scope
   18 |         if (strcmp(s, "print") == 0)
      |             ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <string>
  +++ |+#include <cstring>
    3 | 
a.cc:41:13: error: 'strcpy' was not declared in this scope
   41 |             strcpy(rc, c);
      |             ^~~~~~
a.cc:41:13: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <cstdio>
#include <string>
char c[1001], rc[1001], s[111];
int main()
{
    int a, b, n;
    scanf("%s", c);
    scanf("%d", &n);
    char w[111];
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < 111; j++)
        {
            s[j] = 0;
        }
        scanf("%s ", s);
        if (strcmp(s, "print") == 0)
        {
            scanf("%d %d", &a, &b);
            for (int i = a; i <= b; i++)
            {
                printf("%c", c[i]);
            }
            printf("\n");
        }
        else if (strcmp(s, "replace") == 0)
        {
            scanf("%d %d %s", &a, &b, rc);
            int j = 0;
            for (int i = a; i <= b; i++)
            {
                c[i] = rc[j];
                j++;
            }
        }
        else
        {
            scanf("%d %d", &a, &b);
            int j = b;
            strcpy(rc, c);
            for (int i = a; i <= b; i++)
            {
                c[i] = rc[j];
                j--;
            }
        }
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: 'strcmp' was not declared in this scope
   17 |         if (strcmp(s, "print") == 0)
      |             ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <string>
  +++ |+#include <cstring>
    3 | char c[1001], rc[1001], s[111];
a.cc:40:13: error: 'strcpy' was not declared in this scope
   40 |             strcpy(rc, c);
      |             ^~~~~~
a.cc:40:13: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <cstdio>
#include <string>
char c[1001], rc[1001], s[111];
char w[111];
int main()
{
    int a, b, n;
    scanf("%s", c);
    scanf("%d", &n);

    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < 111; j++)
        {
            s[j] = 0;
        }
        scanf("%s ", s);
        if (strcmp(s, "print") == 0)
        {
            scanf("%d %d", &a, &b);
            for (int i = a; i <= b; i++)
            {
                printf("%c", c[i]);
            }
            printf("\n");
        }
        else if (strcmp(s, "replace") == 0)
        {
            scanf("%d %d %s", &a, &b, rc);
            int j = 0;
            for (int i = a; i <= b; i++)
            {
                c[i] = rc[j];
                j++;
            }
        }
        else
        {
            scanf("%d %d", &a, &b);
            int j = b;
            strcpy(rc, c);
            for (int i = a; i <= b; i++)
            {
                c[i] = rc[j];
                j--;
            }
        }
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:13: error: 'strcmp' was not declared in this scope
   18 |         if (strcmp(s, "print") == 0)
      |             ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <string>
  +++ |+#include <cstring>
    3 | char c[1001], rc[1001], s[111];
a.cc:41:13: error: 'strcpy' was not declared in this scope
   41 |             strcpy(rc, c);
      |             ^~~~~~
a.cc:41:13: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <cstdio>
#include <string>
char c[1001], rc[1001], s[111];
char w[111];
int main()
{
    int a, b, n;
    scanf("%s", c);
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < 111; j++)
        {
            s[j] = 0;
        }
        scanf("%s ", s);
        if (strcmp(s, "print") == 0)
        {
            scanf("%d %d", &a, &b);
            for (int i = a; i <= b; i++)
            {
                printf("%c", c[i]);
            }
        }
        else if (strcmp(s, "replace") == 0)
        {
            scanf("%d %d %s", &a, &b, rc);
            int j = 0;
            for (int i = a; i <= b; i++)
            {
                c[i] = rc[j];
                j++;
            }
        }
        else
        {
            scanf("%d %d", &a, &b);
            int j = b;
            strcpy(rc, c);
            for (int i = a; i <= b; i++)
            {
                c[i] = rc[j];
                j--;
            }
        }
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: 'strcmp' was not declared in this scope
   17 |         if (strcmp(s, "print") == 0)
      |             ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <string>
  +++ |+#include <cstring>
    3 | char c[1001], rc[1001], s[111];
a.cc:39:13: error: 'strcpy' was not declared in this scope
   39 |             strcpy(rc, c);
      |             ^~~~~~
a.cc:39:13: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <cstdio>
#include <string>
char c[1001], rc[1001], s[111] = {};
char w[111] = {};
int main()
{
    int a, b, n;
    scanf("%s", c);
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < 111; j++)
        {
            s[j] = 0;
        }
        scanf("%s ", s);
        if (strcmp(s, "print") == 0)
        {
            scanf("%d %d", &a, &b);
            for (int i = a; i <= b; i++)
            {
                printf("%c", c[i]);
            }
        }
        else if (strcmp(s, "replace") == 0)
        {
            scanf("%d %d %s", &a, &b, rc);
            int j = 0;
            for (int i = a; i <= b; i++)
            {
                c[i] = rc[j];
                j++;
            }
        }
        else
        {
            scanf("%d %d", &a, &b);
            int j = b;
            strcpy(rc, c);
            for (int i = a; i <= b; i++)
            {
                c[i] = rc[j];
                j--;
            }
        }
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: 'strcmp' was not declared in this scope
   17 |         if (strcmp(s, "print") == 0)
      |             ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <string>
  +++ |+#include <cstring>
    3 | char c[1001], rc[1001], s[111] = {};
a.cc:39:13: error: 'strcpy' was not declared in this scope
   39 |             strcpy(rc, c);
      |             ^~~~~~
a.cc:39:13: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <cstdio>
#include <string>
char c[1001], rc[1001], s[111];
char w[111];
int main()
{
    int a, b, n;
    scanf("%s", c);
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        scanf("%s ", s);
        if (strcmp(s, "print") == 0)
        {
            scanf("%d %d", &a, &b);
            for (int i = a; i <= b; i++)
            {
                printf("%c", c[i]);
            }
        }
        else if (strcmp(s, "replace") == 0)
        {
            scanf("%d %d %s", &a, &b, rc);
            int j = 0;
            for (int i = a; i <= b; i++)
            {
                c[i] = rc[j];
                j++;
            }
        }
        else
        {
            scanf("%d %d", &a, &b);
            int j = b;
            strcpy(rc, c);
            for (int i = a; i <= b; i++)
            {
                c[i] = rc[j];
                j--;
            }
        }
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: 'strcmp' was not declared in this scope
   13 |         if (strcmp(s, "print") == 0)
      |             ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <string>
  +++ |+#include <cstring>
    3 | char c[1001], rc[1001], s[111];
a.cc:35:13: error: 'strcpy' was not declared in this scope
   35 |             strcpy(rc, c);
      |             ^~~~~~
a.cc:35:13: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <cstdio>
#include <string>
char c[1001], rc[1001], s[111];
char w[111];
int main()
{
    int a, b, n;
    scanf("%s", c);
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        scanf("%s ", s);
        if (strcmp(s, "print") == 0)
        {
            scanf("%d %d", &a, &b);
            for (int i = a; i <= b; i++)
            {
                printf("%c", c[i]);
            }
            printf("\n");
        }
        else if (strcmp(s, "replace") == 0)
        {
            scanf("%d %d %s", &a, &b, rc);
            int j = 0;
            for (int i = a; i <= b; i++)
            {
                c[i] = rc[j];
                j++;
            }
        }
        else
        {
            scanf("%d %d", &a, &b);
            int j = b;
            strcpy(rc, c);
            for (int i = a; i <= b; i++)
            {
                c[i] = rc[j];
                j--;
            }
        }
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: 'strcmp' was not declared in this scope
   13 |         if (strcmp(s, "print") == 0)
      |             ^~~~~~
a.cc:3:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <string>
  +++ |+#include <cstring>
    3 | char c[1001], rc[1001], s[111];
a.cc:36:13: error: 'strcpy' was not declared in this scope
   36 |             strcpy(rc, c);
      |             ^~~~~~
a.cc:36:13: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include<bits/stdc++.h>
using namespace std;
string Replace(string s,int s,int b,string t){
    for(int i=a,i<=b;i++){
        s[i]=t[i-a];
    }
    return s;
}

string Reverse(string s,int a,int b){
    int i=a,j=b;
    while(i<j){
        swap(s[i],s[j]);
        i++;
        j--;
    }
    return s;
}

void Print(string s,int a,int b){
    for(int i=a;i<=b;i++){
        cout<<s[i];
    }
    cout<<endl;
}

int main(){
    string str,command,t;
    cin>>str;
    int q,a,b;
    cin>>q;
    for(int i=0;i<q;i++){
        cin>>command;
        cin>>a>>b;
        if(command=="replace"){
            cin>>t;
            str=Replace(str,a,b,t);
        }else if(command=="reverse"){
            str=Reverse(str,a,b);
        }else if(command=="print"){
            Print(str,a,b);
        }
    }
    return 0;
    
}


Compiler output:
a.cc:3:29: error: conflicting declaration 'int s'
    3 | string Replace(string s,int s,int b,string t){
      |                         ~~~~^
a.cc:3:23: note: previous declaration as 'std::string s'
    3 | string Replace(string s,int s,int b,string t){
      |                ~~~~~~~^
a.cc: In function 'std::string Replace(...)':
a.cc:4:15: error: 'a' was not declared in this scope
    4 |     for(int i=a,i<=b;i++){
      |               ^
a.cc:4:25: error: expected ';' before ')' token
    4 |     for(int i=a,i<=b;i++){
      |                         ^
      |                         ;
Language: C++

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

int main(){
    string str,command,t;
    cin>>str;
    int q,a,b;
    cin>>q;
    for(int i=0;i<q;i++){
        cin>>command;
        cin>>a>>b;
        if(command=="replace"){
            cin>>t;
            str=Replace(str,a,b,t);
        }else if(command=="reverse"){
            str=Reverse(str,a,b);
        }else if(command=="print"){
            Print(str,a,b);
        }
    }
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'Replace' was not declared in this scope
   14 |             str=Replace(str,a,b,t);
      |                 ^~~~~~~
a.cc:16:17: error: 'Reverse' was not declared in this scope
   16 |             str=Reverse(str,a,b);
      |                 ^~~~~~~
a.cc:18:13: error: 'Print' was not declared in this scope; did you mean 'rint'?
   18 |             Print(str,a,b);
      |             ^~~~~
      |             rint
Language: C++

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

string Replace(string s,int a,int b,string t){
    for(int i=a,i<=b;i++){
        s[i]=t[i-a];
    }
    return s;
}

string Reverse(string s,int a,int b){
    int i=a,j=b;
    while(i<j){
        swap(s[i],s[j]);
        i++;
        j--;
    }
    return s;
}

void Print(string s,int a,int b){
    for(int i=a;i<=b;i++){
        cout<<s[i];
    }
    cout<<endl;
}

int main(){
    string str,command,t;
    cin>>str;
    int q,a,b;
    cin>>q;
    for(int i=0;i<q;i++){
        cin>>command;
        cin>>a>>b;
        if(command=="replace"){
            cin>>t;
            str=Replace(str,a,b,t);
        }else if(command=="reverse"){
            str=Reverse(str,a,b);
        }else if(command=="print"){
            Print(str,a,b);
        }
    }
    return 0;
    
}


Compiler output:
a.cc: In function 'std::string Replace(std::string, int, int, std::string)':
a.cc:5:18: error: expected ';' before '<=' token
    5 |     for(int i=a,i<=b;i++){
      |                  ^~
      |                  ;
a.cc:5:18: error: expected primary-expression before '<=' token
    5 |     for(int i=a,i<=b;i++){
      |                  ^~
Language: C++

#include<iostream>
#include<string>

using namespace std;

int main(){



string str;
int n;
string command;
int first;
int second;
string third;
string revercestr;

cin>>str;
cin>>n;

for(int i=0;i<n;i++){
cin>>command;

if(command=="print"){

cin>>first>>second;
cout<<str.substr(first,second - first)<<endl;

}else if(command=="reverce"){

cin>>first>>second;
for(int i=second;first<=i;i--){
revercestr=revercestr+str[i]
}
str.replace(first,second-first,revercestr);

}else{

cin>>first>>second>>third;
str.replace(first,second-first,third);
}
}


}



Compiler output:
a.cc: In function 'int main()':
a.cc:33:29: error: expected ';' before '}' token
   33 | revercestr=revercestr+str[i]
      |                             ^
      |                             ;
   34 | }
      | ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
string aho(int b,int c,string x){
	long string s;
	for(int i = 0;i<x.size();i++){
		if(i >=b && i<=c) s += x.at(i); 
	}
	//cout<<s<<endl;
	reverse(s.begin(),s.end());
	//cout<<s<<endl;
	return s;
}
int main(void){
	int a,b = 0,c = 0;
	string x;
	string y;
	cin>>x;
	cin>>a;
	for(int i = 0;i<a;i++){
		cin>>y;
		if(y =="replace"){
			string z;
			cin>>b>>c;
			cin>>z;
			x.replace(b,c,z);
		}
		else if(y == "reverse"){
			cin>>b>>c;
			x.replace(b,c+1,aho(b,c,x));
			//cout<<x<<endl;
		}
		else if(y =="print"){
			cin>>b>>c;
			string s;
			for(int j = 0;j<x.size();j++){
				if(b<= j &&  c>= j) s+=x.at(j);
			}
			cout<<s<<endl;
		}
	}
	return 0;
}


Compiler output:
a.cc: In function 'std::string aho(int, int, std::string)':
a.cc:4:21: error: expected initializer before 's'
    4 |         long string s;
      |                     ^
a.cc:6:35: error: 's' was not declared in this scope
    6 |                 if(i >=b && i<=c) s += x.at(i);
      |                                   ^
a.cc:9:17: error: 's' was not declared in this scope
    9 |         reverse(s.begin(),s.end());
      |                 ^
Language: C++

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

int main(){
 string str, com, p;
 int q, a, b;
 cin >> str >> q;
 for(int t=0; t<q; t++){
  cin >> com >> a >> b;
  if( com ++ "print"){
   cout <<str.substr(a, b-a+1( << endl;
  }else if(com == "reverse"){
   string tmp= str.substr(a, b-a+1);
   int n=tmp.size();
   for( int i=0; i<n; i++) str[i+a]=tmp[n-i-1];
 }else if(com=="replace"){
  cin>>p;
  str=str.replace(a, b-a+1, p);
 }
}
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   11 |   if( com ++ "print"){
      |       ~~~~^~
a.cc:11:13: error: expected ')' before string constant
   11 |   if( com ++ "print"){
      |     ~       ^~~~~~~~
      |             )
a.cc:12:32: error: expected primary-expression before '<<' token
   12 |    cout <<str.substr(a, b-a+1( << endl;
      |                                ^~
Language: C++

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

int main(){
 string str, com, p;
 int q, a, b;
 cin >> str >> q;
 for(int t=0; t<q; t++){
  cin >> com >> a >> b;
  if( com == "print"){
   cout <<str.substr(a, b-a+1( << endl;
  }else if(com == "reverse"){
   string tmp= str.substr(a, b-a+1);
   int n=tmp.size();
   for( int i=0; i<n; i++) str[i+a]=tmp[n-i-1];
 }else if(com=="replace"){
  cin>>p;
  str=str.replace(a, b-a+1, p);
 }
}
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:32: error: expected primary-expression before '<<' token
   12 |    cout <<str.substr(a, b-a+1( << endl;
      |                                ^~
Language: C++

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

int main(){
	long long hoge,hoge2;
	cin>>hoge>>hoge2;
	bitset<32> a(hoge),b(hoge2);
	cout<<and(a,b)<<endl<<or(a,b)<<endl<<xor(a,b)<<endl;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: expected identifier before '(' token
    9 |         cout<<and(a,b)<<endl<<or(a,b)<<endl<<xor(a,b)<<endl;
      |                  ^
Language: C++

#include<iostream>
#include<cmath>
#define int long long
long long int f(long long int n){
	int i=0;
	while(pow(2,i)<=n)
		i++;
	return i-1;
}
using namespace std;
int main(){
	int n;
	cin>>n;
	long long int m=0;
	int oron=f(n)+1;
	while(n){
		m+=pow(10, f(n));
		n-=pow(2,f(n));
		//cout<<n<<"----"<<endl;
	}
	for(int i=0; i<32-oron; i++)
		cout<<0;
	cout<<m<<endl;
	for(int i=0; i<32-oron; i++)
		cout<<1;
	for(int i=oron-1; i>=0; i--){
		cout<<1-int(m/(pow(10, i)))%10;
	}
	cout<<endl;
	for(int i=0; i<32-oron-1; i++)
		cout<<0;
	cout<<m<<0<<endl;
	for(int i=0; i<32-oron+1; i++)
		cout<<0;
	cout<<m/10<<endl;
	return 0;
}


Compiler output:
a.cc:3:13: error: 'long long long' is too long for GCC
    3 | #define int long long
      |             ^~~~
a.cc:4:11: note: in expansion of macro 'int'
    4 | long long int f(long long int n){
      |           ^~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long
      |                  ^~~~
a.cc:4:11: note: in expansion of macro 'int'
    4 | long long int f(long long int n){
      |           ^~~
a.cc:3:13: error: 'long long long' is too long for GCC
    3 | #define int long long
      |             ^~~~
a.cc:4:27: note: in expansion of macro 'int'
    4 | long long int f(long long int n){
      |                           ^~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long
      |                  ^~~~
a.cc:4:27: note: in expansion of macro 'int'
    4 | long long int f(long long int n){
      |                           ^~~
cc1plus: error: '::main' must return 'int'
a.cc: In function 'int main()':
a.cc:3:13: error: 'long long long' is too long for GCC
    3 | #define int long long
      |             ^~~~
a.cc:14:19: note: in expansion of macro 'int'
   14 |         long long int m=0;
      |                   ^~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long
      |                  ^~~~
a.cc:14:19: note: in expansion of macro 'int'
   14 |         long long int m=0;
      |                   ^~~
a.cc:3:13: error: expected primary-expression before 'long'
    3 | #define int long long
      |             ^~~~
a.cc:27:25: note: in expansion of macro 'int'
   27 |                 cout<<1-int(m/(pow(10, i)))%10;
      |                         ^~~
Language: C++

#include<iostream>
#include<cmath>
#define int long long
long long int f(long long int n){
	int i=0;
	while(pow(2,i)<=n)
		i++;
	return i-1;
}
using namespace std;
main(){
	int n;
	cin>>n;
	long long int m=0;
	int oron=f(n)+1;
	while(n){
		m+=pow(10, f(n));
		n-=pow(2,f(n));
		//cout<<n<<"----"<<endl;
	}
	for(int i=0; i<32-oron; i++)
		cout<<0;
	cout<<m<<endl;
	for(int i=0; i<32-oron; i++)
		cout<<1;
	for(int i=oron-1; i>=0; i--){
		cout<<1-int(m/(pow(10, i)))%10;
	}
	cout<<endl;
	for(int i=0; i<32-oron-1; i++)
		cout<<0;
	cout<<m<<0<<endl;
	for(int i=0; i<32-oron+1; i++)
		cout<<0;
	cout<<m/10<<endl;
	return 0;
}


Compiler output:
a.cc:3:13: error: 'long long long' is too long for GCC
    3 | #define int long long
      |             ^~~~
a.cc:4:11: note: in expansion of macro 'int'
    4 | long long int f(long long int n){
      |           ^~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long
      |                  ^~~~
a.cc:4:11: note: in expansion of macro 'int'
    4 | long long int f(long long int n){
      |           ^~~
a.cc:3:13: error: 'long long long' is too long for GCC
    3 | #define int long long
      |             ^~~~
a.cc:4:27: note: in expansion of macro 'int'
    4 | long long int f(long long int n){
      |                           ^~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long
      |                  ^~~~
a.cc:4:27: note: in expansion of macro 'int'
    4 | long long int f(long long int n){
      |                           ^~~
a.cc:11:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   11 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:3:13: error: 'long long long' is too long for GCC
    3 | #define int long long
      |             ^~~~
a.cc:14:19: note: in expansion of macro 'int'
   14 |         long long int m=0;
      |                   ^~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long
      |                  ^~~~
a.cc:14:19: note: in expansion of macro 'int'
   14 |         long long int m=0;
      |                   ^~~
a.cc:3:13: error: expected primary-expression before 'long'
    3 | #define int long long
      |             ^~~~
a.cc:27:25: note: in expansion of macro 'int'
   27 |                 cout<<1-int(m/(pow(10, i)))%10;
      |                         ^~~
Language: C++

#include<iostream>
#include<cmath>
#define int long long
long long int f(long long int n){
	int i=0;
	while(pow(2,i)<=n)
		i++;
	return i-1;
}
using namespace std;
main(){
	int n;
	cin>>n;
	long long int m=0;
	int oron=f(n)+1;
	while(n){
		m+=pow(10, f(n));
		n-=pow(2,f(n));
		//cout<<n<<"----"<<endl;
	}
	for(int i=0; i<32-oron; i++)
		cout<<0;
	cout<<m<<endl;
	for(int i=0; i<32-oron; i++)
		cout<<1;
	for(int i=oron-1; i>=0; i--){
		cout<<1-int(m/(pow(10, i)))%10;
	}
	cout<<endl;
	for(int i=0; i<32-oron-1; i++)
		cout<<0;
	cout<<m<<0<<endl;
	for(int i=0; i<32-oron+1; i++)
		cout<<0;
	cout<<m/10<<endl;
	//return 0;
}


Compiler output:
a.cc:3:13: error: 'long long long' is too long for GCC
    3 | #define int long long
      |             ^~~~
a.cc:4:11: note: in expansion of macro 'int'
    4 | long long int f(long long int n){
      |           ^~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long
      |                  ^~~~
a.cc:4:11: note: in expansion of macro 'int'
    4 | long long int f(long long int n){
      |           ^~~
a.cc:3:13: error: 'long long long' is too long for GCC
    3 | #define int long long
      |             ^~~~
a.cc:4:27: note: in expansion of macro 'int'
    4 | long long int f(long long int n){
      |                           ^~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long
      |                  ^~~~
a.cc:4:27: note: in expansion of macro 'int'
    4 | long long int f(long long int n){
      |                           ^~~
a.cc:11:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   11 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:3:13: error: 'long long long' is too long for GCC
    3 | #define int long long
      |             ^~~~
a.cc:14:19: note: in expansion of macro 'int'
   14 |         long long int m=0;
      |                   ^~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long
      |                  ^~~~
a.cc:14:19: note: in expansion of macro 'int'
   14 |         long long int m=0;
      |                   ^~~
a.cc:3:13: error: expected primary-expression before 'long'
    3 | #define int long long
      |             ^~~~
a.cc:27:25: note: in expansion of macro 'int'
   27 |                 cout<<1-int(m/(pow(10, i)))%10;
      |                         ^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int a,b;
    cin>>a>>b;
    bitset<32>c(a);
    bitset<32>d(b);
    cout<<c&&d<<endl;
    cout<<c||d<<endl;
    cout<<c^d<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'bitset' was not declared in this scope
    6 |     bitset<32>c(a);
      |     ^~~~~~
a.cc:2:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
    1 | #include<iostream>
  +++ |+#include <bitset>
    2 | using namespace std;
a.cc:6:15: error: 'c' was not declared in this scope
    6 |     bitset<32>c(a);
      |               ^
a.cc:7:15: error: 'd' was not declared in this scope
    7 |     bitset<32>d(b);
      |               ^
Language: C++

#include<iostream>
using namespace std;
int main(){
    int a,b;
    cin>>a>>b;
    bitset<32>c(a);
    bitset<32>d(b);
    cout<<c&d<<endl;
    cout<<c|d<<endl;
    cout<<c^d<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'bitset' was not declared in this scope
    6 |     bitset<32>c(a);
      |     ^~~~~~
a.cc:2:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
    1 | #include<iostream>
  +++ |+#include <bitset>
    2 | using namespace std;
a.cc:6:15: error: 'c' was not declared in this scope
    6 |     bitset<32>c(a);
      |               ^
a.cc:7:15: error: 'd' was not declared in this scope
    7 |     bitset<32>d(b);
      |               ^
Language: C++

#include<iostream>
using namespace std;
int main(){
    int a,b;
    cin>>a>>b;
    bitset<32>c(a);
    bitset<32>d(b);
    cout<<(c&d)<<endl;
    cout<<(c|d)<<endl;
    cout<<(c^d)<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'bitset' was not declared in this scope
    6 |     bitset<32>c(a);
      |     ^~~~~~
a.cc:2:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
    1 | #include<iostream>
  +++ |+#include <bitset>
    2 | using namespace std;
a.cc:6:15: error: 'c' was not declared in this scope
    6 |     bitset<32>c(a);
      |               ^
a.cc:7:15: error: 'd' was not declared in this scope
    7 |     bitset<32>d(b);
      |               ^
Language: C++

#include<iostream>
#include<bitset>
#define int long long
using namespace std;
int main(){
    int a,b;
    cin>>a>>b;
    bitset<32>c(a);
    bitset<32>d(b);
    cout<<(c&d)<<endl;
    cout<<(c|d)<<endl;
    cout<<(c^d)<<endl;
    return 0;
}
/*
#include <bits/stdc++.h>
#define int long long
using namespace std;
main(){
  int x,y;
  cin>>x>>y;
  bitset<32>a(y),b(x);
  //cout<<b<<endl;
  //cout<<(~b)<<endl;
  //cout<<(b<<1)<<endl;
  //cout<<(b>>1)<<endl;
  cout<<(a&b)<<endl;
  cout<<(a|b)<<endl;
  cout<<(a^b)<<endl;
}
*/


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include<iostream>
#include<bitset>
#define int long long
using namespace std;
long long main(){
    int a,b;
    cin>>a>>b;
    bitset<32>c(a);
    bitset<32>d(b);
    cout<<(c&d)<<endl;
    cout<<(c|d)<<endl;
    cout<<(c^d)<<endl;
    return 0;
}
/*
#include <bits/stdc++.h>
#define int long long
using namespace std;
main(){
  int x,y;
  cin>>x>>y;
  bitset<32>a(y),b(x);
  //cout<<b<<endl;
  //cout<<(~b)<<endl;
  //cout<<(b<<1)<<endl;
  //cout<<(b>>1)<<endl;
  cout<<(a&b)<<endl;
  cout<<(a|b)<<endl;
  cout<<(a^b)<<endl;
}
*/


Compiler output:
cc1plus: error: '::main' must return 'int'