Language: C

main(){int l,r,q,n=1;char c[600000];scanf("%s%d",c+(l=200000),&q);for(r=l;*(c+r)!='\0';++r);do *c=='1'?++n:(*(c+2)^n&1?*(c+r++)=*(c+4):*(c+--l)=*(c+4));while(q--&&gets(c));if(n&1)for(;l<r;putchar(*(c+l++)));else for(;l<r;putchar(*(c+--r)));}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | main(){int l,r,q,n=1;char c[600000];scanf("%s%d",c+(l=200000),&q);for(r=l;*(c+r)!='\0';++r);do *c=='1'?++n:(*(c+2)^n&1?*(c+r++)=*(c+4):*(c+--l)=*(c+4));while(q--&&gets(c));if(n&1)for(;l<r;putchar(*(c+l++)));else for(;l<r;putchar(*(c+--r)));}
      | ^~~~
main.c: In function 'main':
main.c:1:37: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    1 | main(){int l,r,q,n=1;char c[600000];scanf("%s%d",c+(l=200000),&q);for(r=l;*(c+r)!='\0';++r);do *c=='1'?++n:(*(c+2)^n&1?*(c+r++)=*(c+4):*(c+--l)=*(c+4));while(q--&&gets(c));if(n&1)for(;l<r;putchar(*(c+l++)));else for(;l<r;putchar(*(c+--r)));}
      |                                     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | main(){int l,r,q,n=1;char c[600000];scanf("%s%d",c+(l=200000),&q);for(r=l;*(c+r)!='\0';++r);do *c=='1'?++n:(*(c+2)^n&1?*(c+r++)=*(c+4):*(c+--l)=*(c+4));while(q--&&gets(c));if(n&1)for(;l<r;putchar(*(c+l++)));else for(;l<r;putchar(*(c+--r)));}
main.c:1:37: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    1 | main(){int l,r,q,n=1;char c[600000];scanf("%s%d",c+(l=200000),&q);for(r=l;*(c+r)!='\0';++r);do *c=='1'?++n:(*(c+2)^n&1?*(c+r++)=*(c+4):*(c+--l)=*(c+4));while(q--&&gets(c));if(n&1)for(;l<r;putchar(*(c+l++)));else for(;l<r;putchar(*(c+--r)));}
      |                                     ^~~~~
main.c:1:37: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:144: error: lvalue required as left operand of assignment
    1 | main(){int l,r,q,n=1;char c[600000];scanf("%s%d",c+(l=200000),&q);for(r=l;*(c+r)!='\0';++r);do *c=='1'?++n:(*(c+2)^n&1?*(c+r++)=*(c+4):*(c+--l)=*(c+4));while(q--&&gets(c));if(n&1)for(;l<r;putchar(*(c+l++)));else for(;l<r;putchar(*(c+--r)));}
      |                                                                                                                                                ^
main.c:1:164: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration]
    1 | main(){int l,r,q,n=1;char c[600000];scanf("%s%d",c+(l=200000),&q);for(r=l;*(c+r)!='\0';++r);do *c=='1'?++n:(*(c+2)^n&1?*(c+r++)=*(c+4):*(c+--l)=*(c+4));while(q--&&gets(c));if(n&1)for(;l<r;putchar(*(c+l++)));else for(;l<r;putchar(*(c+--r)));}
      |                                                                                                                                                                    ^~~~
main.c:1:189: error: implicit declaration of function 'putchar' [-Wimplicit-function-declaration]
    1 | main(){int l,r,q,n=1;char c[600000];scanf("%s%d",c+(l=200000),&q);for(r=l;*(c+r)!='\0';++r);do *c=='1'?++n:(*(c+2)^n&1?*(c+r++)=*(c+4):*(c+--l)=*(c+4));while(q--&&gets(c));if(n&1)for(;l<r;putchar(*(c+l++)));else for(;l<r;putchar(*(c+--r)));}
      |                                                                                                                                                                                             ^~~~~~~
main.c:1:189: note: include '<stdio.h>' or provide a declaration of 'putchar'