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

main(){char s[1001],*a;scanf("%s",a=s);for(;*a;a++)*a=(*a-42)%26+65;puts(s);return 0;}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){char s[1001],*a;scanf("%s",a=s);for(;*a;a++)*a=(*a-42)%26+65;puts(s);return 0;}
      | ^~~~
a.cc: In function 'int main()':
a.cc:1:24: error: 'scanf' was not declared in this scope
    1 | main(){char s[1001],*a;scanf("%s",a=s);for(;*a;a++)*a=(*a-42)%26+65;puts(s);return 0;}
      |                        ^~~~~
a.cc:1:69: error: 'puts' was not declared in this scope
    1 | main(){char s[1001],*a;scanf("%s",a=s);for(;*a;a++)*a=(*a-42)%26+65;puts(s);return 0;}
      |                                                                     ^~~~
Language: C++

main(a){for(;~scanf("%d",&c);printf("%c",(c-62)%26+65));}

Compiler output:
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
    1 | main(a){for(;~scanf("%d",&c);printf("%c",(c-62)%26+65));}
      |     ^
Language: C++

#include<iostream>
#include<string>

int main()
{
string s;
while(cin>>s){
for(int i=0;i<s.size();i++){
int a=s[i]-'A';
a+=3;
a%=26;
char p='A'+a;
cout<<p;
}
cout<<endl;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:1: error: 'string' was not declared in this scope
    6 | string s;
      | ^~~~~~
a.cc:6:1: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:7:7: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 | while(cin>>s){
      |       ^~~
      |       std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:12: error: 's' was not declared in this scope
    7 | while(cin>>s){
      |            ^
a.cc:13:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 | cout<<p;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 | cout<<endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:7: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 | cout<<endl;
      |       ^~~~
      |       std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
#include<cstring>
using namespace std;
int main(){
	int s[1001];
	ci>>s;
	for(int i=0;i<strlen(s);i++){
		switch(s[i]){
			case 'X':
			cout<<'A';
			break;
			case 'Y':
			cout<<'B';
			break;
			case 'Z':
			cout<<'C';
			break;
			default:
			cout<<(char)(s[i]+3);	
		}
	}
	cout<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'ci' was not declared in this scope
    6 |         ci>>s;
      |         ^~
a.cc:7:30: error: cannot convert 'int*' to 'const char*'
    7 |         for(int i=0;i<strlen(s);i++){
      |                              ^
      |                              |
      |                              int*
In file included from /usr/include/c++/14/cstring:43,
                 from a.cc:2:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
Language: C++

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>

using namespace std;

int main(){
  int n = 0;
  char t[1001] = {0};
  gets(t);
  for(n = 0; n < 1001; n++){
    if(t[n] == 0)
      break;
    t[n] += 3;
    if(t[n] > 'z')
      t[n] -= 'z' - 'a' + 1;
    printf("%c", t[n]);
  }
  printf("\n");

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'gets' was not declared in this scope; did you mean 'getw'?
   11 |   gets(t);
      |   ^~~~
      |   getw
a.cc:20:16: error: expected '}' at end of input
   20 |   printf("\n");
      |                ^
a.cc:8:11: note: to match this '{'
    8 | int main(){
      |           ^
Language: C++

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>

using namespace std;

int main(){
  int n = 0;
  char t[1001] = {0};
  gets(t);
  for(n = 0; n < 1001; n++){
    if(t[n] == 0)
      break;
    t[n] += 3;
    if(t[n] > 'z')
      t[n] -= 'z' - 'a' + 1;
    printf("%c", t[n]);
  }
  printf("\n");
  return0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'gets' was not declared in this scope; did you mean 'getw'?
   11 |   gets(t);
      |   ^~~~
      |   getw
a.cc:21:3: error: 'return0' was not declared in this scope
   21 |   return0;
      |   ^~~~~~~
Language: C++

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>

using namespace std;

int main(){
  int n = 0;
  char t[1001] = {0};
  gets(t);
  for(n = 0; n < 1001; n++){
    if(t[n] == 0)
      break;
    t[n] += 3;
    if(t[n] > 'z')
      t[n] -= 'z' - 'a' + 1;
    printf("%c", t[n]);
  }
  printf("\n");
 return0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'gets' was not declared in this scope; did you mean 'getw'?
   11 |   gets(t);
      |   ^~~~
      |   getw
a.cc:21:2: error: 'return0' was not declared in this scope
   21 |  return0;
      |  ^~~~~~~
Language: C++

#include<stdio.h>
int main()
{
	char a[1001];
	int i=0;
	while (scanf("%c", &a[i]) != EOF){


		if (a[i] == 'A'){
			a[i] = 'X';
		}
		else if (a[i] == 'B'){
			a[i] = 'Y';
		}
		else if (a[i] == 'C'){
			a[i] = 'Z';
		}
		else if('D'<=a[i]&&'Z'>=a[i]){
			a[i] -= 3;
		}
		printf("%c", a[i]);
		i++;
	}

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

#include <iostream>
#include <cstring>
using namespace std;
int main() {
char a[1000],b[1000];
cin.getline(a,1000);
size_t len;
len=stlen(a);
    
for(int i=0;i<len;i++){
if (a[i]>'C'){
b[i]=a[i]-3;
cout<<b[i];}
else{
b[i]=a[i]+26-3;
cout<<b[i];}}
return 0;
}

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

#include <iostream>
#include <cstring>
using namespace std;
int main() {
char a[1000],b[1000];
cin.getline(a,1000);
size_t len;
len=stren(a);
    
for(int i=0;i<len;i++){
if (a[i]>'C'){
b[i]=a[i]-3;
cout<<b[i];}
else{
b[i]=a[i]+26-3;
cout<<b[i];}}
return 0;
}

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


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

int main()
{
	string S;
	cin >> S;
	for(int i=0;i<S.size();i++){
		if(S[i]==(int)"A"||S[i]==(int)"B"||S[i]==(int)"C")
			S[i]+=26;
		S[i]-=3;
		cout << S[i] ;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:26: error: cast from 'const char*' to 'int' loses precision [-fpermissive]
   11 |                 if(S[i]==(int)"A"||S[i]==(int)"B"||S[i]==(int)"C")
      |                          ^~~~~~~~
a.cc:11:42: error: cast from 'const char*' to 'int' loses precision [-fpermissive]
   11 |                 if(S[i]==(int)"A"||S[i]==(int)"B"||S[i]==(int)"C")
      |                                          ^~~~~~~~
a.cc:11:58: error: cast from 'const char*' to 'int' loses precision [-fpermissive]
   11 |                 if(S[i]==(int)"A"||S[i]==(int)"B"||S[i]==(int)"C")
      |                                                          ^~~~~~~~
Language: C++

//

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

int main()
{
	string S;
	cin >> S;
	for(int i=0;i<S.size();i++){
		if(S[i]==(int)"A"||S[i]==(int)"B"||S[i]==(int)"C")
			S[i]+=26;
		S[i]-=3;
		cout << S[i] ;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: error: cast from 'const char*' to 'int' loses precision [-fpermissive]
   12 |                 if(S[i]==(int)"A"||S[i]==(int)"B"||S[i]==(int)"C")
      |                          ^~~~~~~~
a.cc:12:42: error: cast from 'const char*' to 'int' loses precision [-fpermissive]
   12 |                 if(S[i]==(int)"A"||S[i]==(int)"B"||S[i]==(int)"C")
      |                                          ^~~~~~~~
a.cc:12:58: error: cast from 'const char*' to 'int' loses precision [-fpermissive]
   12 |                 if(S[i]==(int)"A"||S[i]==(int)"B"||S[i]==(int)"C")
      |                                                          ^~~~~~~~
Language: Java

import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		static int n = stdIn.nextInt();
		static int[] cardSet = cardSet[2*n];
		
		for(int i=0;i<n*2;i++){
			cardSet[i] = i+1;
		}
		int m = stdIn.nextInt();
		for(i=0;i<m;i++){
			int shuffle = stdIn.nextInt();
			if(shuffle != 0){
				hinduShuffle(shuffle);
			}else{
				riffleShuffle();
			}
		}
		for(i=0;i<cardSet.length;i++){
			System.out.println(cardSet[i]);
		}
	}
	public static void hinduShuffle(int shufflePosition){
		int temp[] = new Integer[shufflePosition];
		for(int i=0;i<shufflePosition;i++){
			temp[i] = cardSet[i];
		}
		int shufflePositionTemp = shufflePosition;
		for(i=0;i<cardSet.length-shufflePosition;i++){
			cardSet[i] = cardSet[shufflePositionTemp];
			shufflePositionTemp++;
		}
	}
	public static void riffleShuffle(){
		int[] cardSetCopy = (Integer[])cardSet.clone();
		for(int i=1;i<n;i++){
			cardSet[i*2] = cardSet[i];
		}
		int x = 0;
		for(int j=1;j<2*n;j+=2){
			cardSet[j] = cardSetCopy[n+x];
			x++;
		}
	}
}

Compiler output:
Main.java:6: error: illegal start of expression
		static int n = stdIn.nextInt();
		^
Main.java:9: error: illegal start of type
		for(int i=0;i<n*2;i++){
		^
Main.java:9: error: > or ',' expected
		for(int i=0;i<n*2;i++){
		               ^
Main.java:9: error: <identifier> expected
		for(int i=0;i<n*2;i++){
		                   ^
Main.java:13: error: illegal start of type
		for(i=0;i<m;i++){
		^
Main.java:13: error: <identifier> expected
		for(i=0;i<m;i++){
		     ^
Main.java:13: error: > or ',' expected
		for(i=0;i<m;i++){
		           ^
Main.java:13: error: <identifier> expected
		for(i=0;i<m;i++){
		             ^
Main.java:21: error: illegal start of type
		for(i=0;i<cardSet.length;i++){
		^
Main.java:21: error: <identifier> expected
		for(i=0;i<cardSet.length;i++){
		     ^
Main.java:21: error: > or ',' expected
		for(i=0;i<cardSet.length;i++){
		                        ^
Main.java:21: error: <identifier> expected
		for(i=0;i<cardSet.length;i++){
		                          ^
Main.java:25: error: unnamed classes are a preview feature and are disabled by default.
	public static void hinduShuffle(int shufflePosition){
	              ^
  (use --enable-preview to enable unnamed classes)
Main.java:47: error: class, interface, enum, or record expected
}
^
14 errors
Language: Java

import java.util.Scanner;

class Main{
	static int n = 0;
	static int[] cardSet = null;
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		n = stdIn.nextInt();
		cardSet = Integer[2*n];
		
		for(int i=0;i<n*2;i++){
			cardSet[i] = i+1;
		}
		int m = stdIn.nextInt();
		for(i=0;i<m;i++){
			int shuffle = stdIn.nextInt();
			if(shuffle != 0){
				hinduShuffle(shuffle);
			}else{
				riffleShuffle();
			}
		}
		for(i=0;i<cardSet.length;i++){
			System.out.println(cardSet[i]);
		}
	}
	public static void hinduShuffle(int shufflePosition){
		int temp[] = new Integer[shufflePosition];
		for(int i=0;i<shufflePosition;i++){
			temp[i] = cardSet[i];
		}
		int shufflePositionTemp = shufflePosition;
		for(i=0;i<cardSet.length-shufflePosition;i++){
			cardSet[i] = cardSet[shufflePositionTemp];
			shufflePositionTemp++;
		}
	}
	public static void riffleShuffle(){
		int[] cardSetCopy = (Integer[])cardSet.clone();
		for(int i=1;i<n;i++){
			cardSet[i*2] = cardSet[i];
		}
		int x = 0;
		for(int j=1;j<2*n;j+=2){
			cardSet[j] = cardSetCopy[n+x];
			x++;
		}
	}
}

Compiler output:
Main.java:9: error: cannot find symbol
		cardSet = Integer[2*n];
		          ^
  symbol:   variable Integer
  location: class Main
Main.java:15: error: cannot find symbol
		for(i=0;i<m;i++){
		    ^
  symbol:   variable i
  location: class Main
Main.java:15: error: cannot find symbol
		for(i=0;i<m;i++){
		        ^
  symbol:   variable i
  location: class Main
Main.java:15: error: cannot find symbol
		for(i=0;i<m;i++){
		            ^
  symbol:   variable i
  location: class Main
Main.java:23: error: cannot find symbol
		for(i=0;i<cardSet.length;i++){
		    ^
  symbol:   variable i
  location: class Main
Main.java:23: error: cannot find symbol
		for(i=0;i<cardSet.length;i++){
		        ^
  symbol:   variable i
  location: class Main
Main.java:23: error: cannot find symbol
		for(i=0;i<cardSet.length;i++){
		                         ^
  symbol:   variable i
  location: class Main
Main.java:24: error: cannot find symbol
			System.out.println(cardSet[i]);
			                           ^
  symbol:   variable i
  location: class Main
Main.java:28: error: incompatible types: Integer[] cannot be converted to int[]
		int temp[] = new Integer[shufflePosition];
		             ^
Main.java:33: error: cannot find symbol
		for(i=0;i<cardSet.length-shufflePosition;i++){
		    ^
  symbol:   variable i
  location: class Main
Main.java:33: error: cannot find symbol
		for(i=0;i<cardSet.length-shufflePosition;i++){
		        ^
  symbol:   variable i
  location: class Main
Main.java:33: error: cannot find symbol
		for(i=0;i<cardSet.length-shufflePosition;i++){
		                                         ^
  symbol:   variable i
  location: class Main
Main.java:34: error: cannot find symbol
			cardSet[i] = cardSet[shufflePositionTemp];
			        ^
  symbol:   variable i
  location: class Main
Main.java:39: error: incompatible types: int[] cannot be converted to Integer[]
		int[] cardSetCopy = (Integer[])cardSet.clone();
		                                            ^
14 errors
Language: Java

import java.util.Scanner;

class Main{
	static int n = 0;
	static int[] cardSet = null;
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		n = stdIn.nextInt();
		cardSet = new Integer[2*n];
		
		for(int i=0;i<n*2;i++){
			cardSet[i] = i+1;
		}
		int m = stdIn.nextInt();
		for(int i=0;i<m;i++){
			int shuffle = stdIn.nextInt();
			if(shuffle != 0){
				hinduShuffle(shuffle);
			}else{
				riffleShuffle();
			}
		}
		for(int i=0;i<cardSet.length;i++){
			System.out.println(cardSet[i]);
		}
	}
	public static void hinduShuffle(int shufflePosition){
		int temp[] = new Integer[shufflePosition];
		for(int i=0;i<shufflePosition;i++){
			temp[i] = cardSet[i];
		}
		int shufflePositionTemp = shufflePosition;
		for(i=0;i<cardSet.length-shufflePosition;i++){
			cardSet[i] = cardSet[shufflePositionTemp];
			shufflePositionTemp++;
		}
	}
	public static void riffleShuffle(){
		int[] cardSetCopy = (Integer[])cardSet.clone();
		for(int i=1;i<n;i++){
			cardSet[i*2] = cardSet[i];
		}
		int x = 0;
		for(int j=1;j<2*n;j+=2){
			cardSet[j] = cardSetCopy[n+x];
			x++;
		}
	}
}

Compiler output:
Main.java:9: error: incompatible types: Integer[] cannot be converted to int[]
		cardSet = new Integer[2*n];
		          ^
Main.java:28: error: incompatible types: Integer[] cannot be converted to int[]
		int temp[] = new Integer[shufflePosition];
		             ^
Main.java:33: error: cannot find symbol
		for(i=0;i<cardSet.length-shufflePosition;i++){
		    ^
  symbol:   variable i
  location: class Main
Main.java:33: error: cannot find symbol
		for(i=0;i<cardSet.length-shufflePosition;i++){
		        ^
  symbol:   variable i
  location: class Main
Main.java:33: error: cannot find symbol
		for(i=0;i<cardSet.length-shufflePosition;i++){
		                                         ^
  symbol:   variable i
  location: class Main
Main.java:34: error: cannot find symbol
			cardSet[i] = cardSet[shufflePositionTemp];
			        ^
  symbol:   variable i
  location: class Main
Main.java:39: error: incompatible types: int[] cannot be converted to Integer[]
		int[] cardSetCopy = (Integer[])cardSet.clone();
		                                            ^
7 errors
Language: C

#include<stdio.h>
int main(){
int n,m,k,i,j,l=1;
scanf("%d\n%d\n",&n,&m);
int before[n*2],after[n*2];
for(i=0;i<n*2;i++){
before[i]=i+1;
}
for(i=0;i<m;i++){
scanf("%d\n",&k);
if(k==0){
for(j=0;j<n*2;j++){
after[j]=before[j];
after[l]=before[n+j+1];
l+=2;
}
}else{
for(j=0;j<2*n-k;j++){
after[j]=before[k+j];
}
for(j=0;j<k;j++){
after[2*n-k+j]=before[j];
}

for(j=0;j<2*n;j++){
before[j]=after[j];
}
}
for(i=0;i<n*2;i++){
printf("%d\n",before[i]);
}
return 0;
}

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

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

void shuffle(int **p,int k,int arraynum){
	int* first;
	first = (int *)calloc(k,sizeof(int));
	if(first == NULL){
		exit(EXIT_FAILURE);
	}
	int* second;
	second = (int *)calloc(arraynum-k,sizeof(int));
	if(second == NULL){
		exit(EXIT_FAILURE);
	}
	
	int i;
	for(i=0;i<k;i++){
		first[i] = *p[i];
	}
	for(;i<arraynum;i++){
		second[i-k] = *p[i];
	}
	for(i=0;i<2*arraynum;i++){
		if(i<(arraynum-k)){
			*p[i] = second[i];
		}
		else{
			*p[i] = first[i+k-arraynum];
		}
	}
}

void refshf(int **p,int arraynum){
	int* first;
	first = (int *)calloc(arraynum,sizeof(int));
	int* second;
	second = (int *)calloc(arraynum,sizeof(int));
	int i;
	for(i=0;i<arraynum;i++){
		first[i] = *p[i];
		second[i] = *p[i+arraynum];
	}
	for(i=0;i<2*arraynum;i++){
		switch(i%2){
			case (0):*p[i] = first[i/2];
			case (1):*p[i] = second[i/2];
		}
	}
}

void center(int **p1,int **p2,int arraynum){
	int i;
	for(i=0;i<sizeof(*p1);i++){
		switch(*p1[i]){
			case 0: refshf(&(*p2),arraynum);break;
			default: shuffle(&(*p2),*p1[i],arraynum);break;
		}
	}
	for(i=0;i<sizeof(p2);i++){
		printf("%d\n",*p2[i]);
	}
}

int main(void)
{
	int arraynum,times;
	int *shfjudge,*array;
	
	scanf_s("%d",&arraynum);
	array = (int *)calloc(2*arraynum,sizeof(int));
	if(array == NULL){
		return EXIT_FAILURE;
	}
	scanf_s("%d",&times);
	shfjudge = (int *)calloc(times,sizeof(int));
	if(shfjudge == NULL){
		return EXIT_FAILURE;
	}
	
	int i;
	for(i=0;i<arraynum;i++){
		array[i] = i;
	}	
	for(i=0;i<times;i++){
		scanf_s("%d",&shfjudge[i]);
	}
	center(&shfjudge,&array,arraynum);
	return 0;
}


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

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

void shuffle(int **p,int k,int arraynum){
	int* first;
	first = (int *)calloc(k,sizeof(int));
	if(first == NULL){
		exit(EXIT_FAILURE);
	}
	int* second;
	second = (int *)calloc(arraynum-k,sizeof(int));
	if(second == NULL){
		exit(EXIT_FAILURE);
	}
	
	int i;
	for(i=0;i<k;i++){
		first[i] = *p[i];
	}
	for(;i<arraynum;i++){
		second[i-k] = *p[i];
	}
	for(i=0;i<2*arraynum;i++){
		if(i<(arraynum-k)){
			*p[i] = second[i];
		}
		else{
			*p[i] = first[i+k-arraynum];
		}
	}
}

void refshf(int **p,int arraynum){
	int* first;
	first = (int *)calloc(arraynum,sizeof(int));
	int* second;
	second = (int *)calloc(arraynum,sizeof(int));
	int i;
	for(i=0;i<arraynum;i++){
		first[i] = *p[i];
		second[i] = *p[i+arraynum];
	}
	for(i=0;i<2*arraynum;i++){
		switch(i%2){
			case (0):*p[i] = first[i/2];
			case (1):*p[i] = second[i/2];
		}
	}
}

void center(int **p1,int **p2,int arraynum){
	int i;
	for(i=0;i<sizeof(*p1);i++){
		switch(*p1[i]){
			case 0: refshf(&(*p2),arraynum);break;
			default: shuffle(&(*p2),*p1[i],arraynum);break;
		}
	}
	for(i=0;i<sizeof(p2);i++){
		printf("%d\n",*p2[i]);
	}
}

int main(void)
{
	int arraynum,times;
	int *shfjudge,*array;
	
	scanf_s("%d",&arraynum);
	array = (int *)calloc(2*arraynum,sizeof(int));
	if(array == NULL){
		return EXIT_FAILURE;
	}
	scanf_s("%d",&times);
	shfjudge = (int *)calloc(times,sizeof(int));
	if(shfjudge == NULL){
		return EXIT_FAILURE;
	}
	
	int i;
	for(i=0;i<arraynum;i++){
		array[i] = i;
	}	
	for(i=0;i<times;i++){
		scanf("%d",&shfjudge[i]);
	}
	center(&shfjudge,&array,arraynum);
	return 0;
}


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

#include <stdio.h>

int main(){
int n,k,i,j,t,m,a[201],b[201];
scanf("%d",&n);
for(i=1;i<=2*n;i++){
a[i]=i;
}
scanf("%d",&m);
for(i=0;i<m;i++){
scanf("%d",&k);
if(k==0){
t=1;
for(j=1;j<=n;j=j+2){
b[j]=a[t];
b[j+1]=a[n+t];
t++;
}
for(j=1;j<=2*n;j++){
a[j]=b[j];
}
}
else if(1<=k && k<=2*n-1){
t=1;
for(j=k+1;j<=2*n-k;j++){
b[t]=a[j];
t++;
}
for(j=1;j<=k;j++){
b[t]=a[j];
t++;
}
for(j=1;j<=2*n;j++){
a[j]=b[j];
}
}


for(i=1;i<=2*n;i++){
printf("%d\n",a[i]);
}

return 0;
}

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

#include <stdio.h>

int main(void){
	int i, j, k, m, n, card[201], tmp[201];
	scanf("%d %d", &n, &m);
	for(i = 1; i <= 2 * n; i++) card[i] = i;

	for(i = 0; i < m; i++){
			scanf("%d", &k);
			for(j = 1; j <= 2 * n; j++) tmp[j] = card[j];

			if(k == 0){
				for(j = 1; j <= n; j++);
					card[2 * j - 1] = tmp[j];
					card[2 * j] = tmp[j + n];
			}
		}
	else{
		for(j = 1; j <= 2 * n - k; j++)
			card[j] = tmp[j + k];
		for(j = 2 * n - k + 1; j <= 2 * n + k)
			card[j] = tmp[j - 2 * n + k];
		}
	}
	for(i = 1; i <= 2 * n; i++) printf("%d\n", card[i]);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:9: error: 'else' without a previous 'if'
   18 |         else{
      |         ^~~~
main.c:21:54: error: expected ';' before ')' token
   21 |                 for(j = 2 * n - k + 1; j <= 2 * n + k)
      |                                                      ^
      |                                                      ;
main.c: At top level:
main.c:25:9: error: expected identifier or '(' before 'for'
   25 |         for(i = 1; i <= 2 * n; i++) printf("%d\n", card[i]);
      |         ^~~
main.c:25:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
   25 |         for(i = 1; i <= 2 * n; i++) printf("%d\n", card[i]);
      |                      ^~
main.c:25:33: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   25 |         for(i = 1; i <= 2 * n; i++) printf("%d\n", card[i]);
      |                                 ^~
main.c:26:9: error: expected identifier or '(' before 'return'
   26 |         return 0;
      |         ^~~~~~
main.c:27:1: error: expected identifier or '(' before '}' token
   27 | }
      | ^
Language: C

#include <stdio.h>

int main(void) {
       int i,j,k,l,m,n,card[201],tmp[201];
   
   for(i = 0; i <= 200; i++) card[i] = i;
   scanf("%d %d", &n, &m);
   
   for(i = 0; i < m; i++){
        scanf("%d", &k);
   for(j=1; j<=2*n;j++) tmp[j]=card[j];

  if(k==0){
      for(j=1;j<=n;j++){
         card[2*j-1]=tmp[j];
         card[2*j]=tmp[j+n];
  }
}
else{
      for(j=1;j<=n-k;j++){
            card[j]=tmp[j+k];

     for(j=2*n-k+1;j<=2*n;j++){
            card[j]=tmp[j-2*n+k];
}
}

for(i = 1; i <= 2*n; i++)printf("%d\n", card[i]);

return(0);
}

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

#include <iostream>
using namespace std;

void cut(int *p, int k, int n) {
    int A[200], i;
    for(i=0;i<k;i++) {
        A[i] = *(p+i); 
    }
    for(i=0;i<2*n-k;i++) {
        *(p+i) = *(p+i+k)
    }
    for(i=0;i<k;i++) {
        *(p+2*n-k) = A[i];
    }
    return;
}

void riffle(int *p, int n) {
    int A[100], B[100], i;
    for(i=0;i<n;i++) {
        A[i] = *(p+i);
        B[i] = *(p+i+n);
    }
    for(i=0;i<2*n;i++) {
        if(i % 2 == 0) *(p+i) = A[i];
        else               *(p+i) = B[i];
    }
    return;
}

int main () {
    int n, p[200], m, a, i;
    cin >> n;
    for (i=0;i<2*n;i++) {
        p[i] = i+1;
    }
    cin >> m;
    for(i=0;i<m;i++) {
        cin >> a;
        if(a=0) riffle(p,n);
        else     cut(p,a,n);
    }
    for(i=0;i<2*n;i++) {
        cout << p[i] << endl;
    }
}

Compiler output:
a.cc: In function 'void cut(int*, int, int)':
a.cc:10:26: error: expected ';' before '}' token
   10 |         *(p+i) = *(p+i+k)
      |                          ^
      |                          ;
   11 |     }
      |     ~
Language: C++

#include <iostream>
using namespace std;
int n, m, a[1000] = { 1 } ,b[400] ,i;
int katto(){
	int f[400] = {};
	for (int k = 0; k < (2 * n); i++){
		f[i] = b[i];
	}
	for (int k = 0; k < (2*n)-i; k++){
		b[k] = f[i + k];
	}
	for (int k = 0; k < i; k++){
		b[k + i] = f[k];
	}
	return;
}
int refuru(){
	int f[400] = {};
	for (int i = 0; i < (2 * n); i++){
		f[i * 2] = b[i];
	}
	for (int i = 0; i < n; i + 2){
		f[i + 1] = f[n + i];
	}
	for (int i = 0; i < 2*n; i++){
		b[i] = f[i];
	}
	return;
}

int main() {
	
	cin >> n >> m;
	for (int l = 0; l < (2 * n); l++){
		b[l] = l;
	}
		for ( i = 0; i < m; i ++){
		cin >> a[i];
		if (a[i] == 0){
			refuru();
		}
		if (a[i] != 0){
			katto();
		}
	}
		for (int l = 0; l < (2 * n); l++){
			cout << b[i] << endl;
		}
	
		return 0;
	}

Compiler output:
a.cc: In function 'int katto()':
a.cc:15:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   15 |         return;
      |         ^~~~~~
a.cc: In function 'int refuru()':
a.cc:28:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   28 |         return;
      |         ^~~~~~
Language: C++

#include <iostream>
using namespace std;
int n, m, a[1000] = { 1 } ,b[400] ,i;
int katto(){
	int f[400] = {};
	for (int k = 0; k < (2 * n); i++){
		f[i] = b[i];
	}
	for (int k = 0; k < (2*n)-i; k++){
		b[k] = f[i + k];
	}
	for (int k = 0; k < i; k++){
		b[k + i] = f[k];
	}
	return;
}
int refuru(){
	int f[400] = {};
	for (int i = 0; i < (2 * n); i++){
		f[i * 2] = b[i];
	}
	for (int i = 0; i < n; i + 2){
		f[i + 1] = f[n + i];
	}
	for (int i = 0; i < 2*n; i++){
		b[i] = f[i];
	}
	return;
}

int main() {
	
	cin >> n >> m;
	for (int l = 0; l < (2 * n); l++){
		b[l] = l;
	}
		for ( i = 0; i < m; i ++){
		cin >> a[i];
		if (a[i] == 0){
			refuru();
		}
		if (a[i] != 0){
			katto();
		}
	}
		for (int l = 0; l < (2 * n); l++){
			cout << b[???] << endl;
		}
	
		return 0;
	}

Compiler output:
a.cc: In function 'int katto()':
a.cc:15:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   15 |         return;
      |         ^~~~~~
a.cc: In function 'int refuru()':
a.cc:28:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   28 |         return;
      |         ^~~~~~
a.cc: In function 'int main()':
a.cc:47:35: error: expected primary-expression before '?' token
   47 |                         cout << b[???] << endl;
      |                                   ^
a.cc:47:36: error: expected primary-expression before '?' token
   47 |                         cout << b[???] << endl;
      |                                    ^
a.cc:47:37: error: expected primary-expression before '?' token
   47 |                         cout << b[???] << endl;
      |                                     ^
a.cc:47:38: error: expected primary-expression before ']' token
   47 |                         cout << b[???] << endl;
      |                                      ^
a.cc:47:38: error: expected ':' before ']' token
   47 |                         cout << b[???] << endl;
      |                                      ^
      |                                      :
a.cc:47:38: error: expected primary-expression before ']' token
a.cc:47:38: error: expected ':' before ']' token
   47 |                         cout << b[???] << endl;
      |                                      ^
      |                                      :
a.cc:47:38: error: expected primary-expression before ']' token
a.cc:47:38: error: expected ':' before ']' token
   47 |                         cout << b[???] << endl;
      |                                      ^
      |                                      :
a.cc:47:38: error: expected primary-expression before ']' token
Language: C++

#include <cstdio>

using namespace std;

int card[201];

int main()
{
    int n, m; cin >> n >> m;

    for (int i = 1; i <= 2*n; ++i) card[i] = i;

    for (int i = 0; i < m; ++i) {
        int k; cin >> k;
        int temp[201];
        if (k == 0) {
            int idx = 1;
            for (int j = 1; j <= n; ++j) {
                temp[idx]   = card[j];
                temp[idx+1] = card[n+j];
                idx += 2;
            }
        } else {
            int idx = 1;
            for (int j = 0; j < 2*n-k; ++j) {
                temp[idx++] = card[k+1+j];
            }
            for (int j = 0; j < k; ++j) {
                temp[idx++] = card[j+1];
            }
        }

        for (int j = 1; j <= 2 * n; ++j) {
            card[j] = temp[j];
        }
    }

    for (int i = 1; i <= 2*n; ++i) {
        printf("%d\n", card[i]);
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: 'cin' was not declared in this scope
    9 |     int n, m; cin >> n >> m;
      |               ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <cstdio>
  +++ |+#include <iostream>
    2 |
Language: C++

#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>

using namespace std;

int main(){
	int n;
	cin >>n;
		int card[205]={0};
		int cardA[205]={0};
		int cardB[205]={0};
		for(int i=0;i<2*n;i++){cards[i]=i+1;}
		int m;
		cin >>m;
		for(int i=0;i<m;i++){
			int k;
			cin >>k;
			if(k==0){
				for(int i=0;i<n;i++){cardA[i]=car[i];}
				for(int i=0,j=n;i<n;i++,j++){
                        cardB[i]=card[j];
                }
				for(int i=0;i<n;i++){
					cards[2*i] = cardA[i];
					cards[2*i+1] = cardB[i];
                    }
                }
			else{
				for(int i=0;i<k;i++){cardA[i]=card[i];}
				for(int i=k,j=0;i<2*n;i++,j++){cardB[j]=card[i];}
				for(int i=0;i<2*n-k;i++){card[i]=cardB[i];}
				for(int i=2*n-k,j=0;i<2*n;i++,j++){card[i] = cardA[j];}
			}
		}
		for(int i=0;i<2*n;i++){
			cout <<cards[i]<<endl;
		}
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:40: error: 'cards' was not declared in this scope; did you mean 'cardB'?
   14 |                 for(int i=0;i<2*n;i++){cards[i]=i+1;}
      |                                        ^~~~~
      |                                        cardB
a.cc:21:63: error: 'car' was not declared in this scope; did you mean 'card'?
   21 |                                 for(int i=0;i<n;i++){cardA[i]=car[i];}
      |                                                               ^~~
      |                                                               card
a.cc:26:41: error: 'cards' was not declared in this scope; did you mean 'cardB'?
   26 |                                         cards[2*i] = cardA[i];
      |                                         ^~~~~
      |                                         cardB
a.cc:38:32: error: 'cards' was not declared in this scope; did you mean 'cardB'?
   38 |                         cout <<cards[i]<<endl;
      |                                ^~~~~
      |                                cardB
Language: C++

#include<iostream>
using namespace std;
int n,m,a,k[100000][1001];
int main(){for(int i=1;i<=1000;i++){k[0][i]==i;}
cin>>n>>m;
for(int i=1;i<=m;i++){
cin>>a;
if(a>=1){for(int j=a+1;j<=n*2;j++){k[i][j-a]=k[j-1][j];}
for(int j=1;j<=a;j++){k[i][j+(n-a)]=k[i][j];}}
else{for(int j=1;j<=n;j++){k[i][j*2-1]=k[i][j];}
for(int j=1;j<=n;j+){k[i][j*2]=k[i][j+n];}}
}
for(int i=1;i<=n;i++){cout<<k[m][i]<<endl;}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: expected primary-expression before ')' token
   11 | for(int j=1;j<=n;j+){k[i][j*2]=k[i][j+n];}}
      |                    ^
Language: C++

#include<iostream>
using namespace std;
int riffle();
int cut(int);
int n,m,i,j,k;

int cut(int*card,int k,int n){
int spare[2*n];
for(i=0;i<k;i++)spare[(2*n)-k+i]=card[i];
for(i=k;i<(2*n);i++) spare[i-k]=card[i];

for(i=0;i<2*n;i++)card[i]=spare_a[i];
}
int riffle(int*card,int n){
int spare[2*n];
for(i=0;i<2*n;i++){
spare[i*2]=card[i];
spare[i*2+1]=card[n+i];
}
for(i=0;i<2*n;i++) card[i]=spare_a[i];

} 

int main(){
cin>>n>>m;
int card[2*n];
int spare_a[2*n];
for(i=0;i<2*n;i++)card[i]=i+1;
for(i=0;i<m;i++){
cin>>k;
if(k!=0)cut(card,k,n);else riffle(card,n);
}
for(i=0;i<2*n;i++)cout<<card[i]<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int cut(int*, int, int)':
a.cc:12:27: error: 'spare_a' was not declared in this scope; did you mean 'spare'?
   12 | for(i=0;i<2*n;i++)card[i]=spare_a[i];
      |                           ^~~~~~~
      |                           spare
a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type]
   13 | }
      | ^
a.cc: In function 'int riffle(int*, int)':
a.cc:20:28: error: 'spare_a' was not declared in this scope; did you mean 'spare'?
   20 | for(i=0;i<2*n;i++) card[i]=spare_a[i];
      |                            ^~~~~~~
      |                            spare
a.cc:22:1: warning: no return statement in function returning non-void [-Wreturn-type]
   22 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int riffle();
int cut(int);
int n,m,i,j,k;

int cut(int*card,int k,int n){
int spare[2*n];
for(i=0;i<k;i++)spare[(2*n)-k+i]=card[i];
for(i=k;i<(2*n);i++) spare[i-k]=card[i];

for(i=0;i<2*n;i++)card[i]=spare_a[i];
}
int riffle(int*card,int n){
int spare[2*n];
for(i=0;i<2*n;i++){
spare[i*2]=card[i];
spare[i*2+1]=card[n+i];
}
for(i=0;i<2*n;i++) card[i]=spare[i];

} 

int main(){
cin>>n>>m;
int card[2*n];
for(i=0;i<2*n;i++)card[i]=i+1;
for(i=0;i<m;i++){
cin>>k;
if(k!=0)cut(card,k,n);else riffle(card,n);
}
for(i=0;i<2*n;i++)cout<<card[i]<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int cut(int*, int, int)':
a.cc:12:27: error: 'spare_a' was not declared in this scope; did you mean 'spare'?
   12 | for(i=0;i<2*n;i++)card[i]=spare_a[i];
      |                           ^~~~~~~
      |                           spare
a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type]
   13 | }
      | ^
a.cc: In function 'int riffle(int*, int)':
a.cc:22:1: warning: no return statement in function returning non-void [-Wreturn-type]
   22 | }
      | ^
Language: C++

#include<iostream>
using namespace std;

void cut(int*card,int k,int n){
int spare[200];
for(i=0;i<k;i++)spare[(2*n)-k+i]=card[i];
for(i=k;i<(2*n);i++) spare[i-k]=card[i];
for(i=0;i<2*n;i++)card[i]=spare[i];
}
void riffle(int*card,int n){
int spare[200];
for(i=0;i<2*n;i++){
spare[i*2]=card[i];
spare[i*2+1]=card[n+i];
}
for(i=0;i<2*n;i++) card[i]=spare[i];

} 

int main(){
int n,m,i,k;
cin>>n>>m;
int card[200];
for(i=0;i<2*n;i++)card[i]=i+1;
for(i=0;i<m;i++){
cin>>k;
if(k!=0)cut(card,k,n);else riffle(card,n);
}
for(i=0;i<2*n;i++)cout<<card[i]<<endl;
return 0;
}

Compiler output:
a.cc: In function 'void cut(int*, int, int)':
a.cc:6:5: error: 'i' was not declared in this scope
    6 | for(i=0;i<k;i++)spare[(2*n)-k+i]=card[i];
      |     ^
a.cc:7:5: error: 'i' was not declared in this scope
    7 | for(i=k;i<(2*n);i++) spare[i-k]=card[i];
      |     ^
a.cc:8:5: error: 'i' was not declared in this scope
    8 | for(i=0;i<2*n;i++)card[i]=spare[i];
      |     ^
a.cc: In function 'void riffle(int*, int)':
a.cc:12:5: error: 'i' was not declared in this scope
   12 | for(i=0;i<2*n;i++){
      |     ^
a.cc:16:5: error: 'i' was not declared in this scope
   16 | for(i=0;i<2*n;i++) card[i]=spare[i];
      |     ^
Language: C++

#include<iostream>
  
void cut(int* cards,int n,int k) {  
    int result[200];
    int i;
    for(i=0;i<k;i++) {
        result[2*n-k+i]=cards[i];
    }
    for(i=k;i<2*n;i++) {
        result[i-k]=cards[i];
    }
    for(i=0;i<n*2;i++) {
        cards[i]=result[i];
    }
}
  
void rf(int* cards,int n) {
    int result[200];
    int i;
    for(i=0;i<n;i++) {
        result[i*2]=cards[i];
        result[i*2+1]=cards[i+n];
    }
    for(i=0;i<n*2;i++) {
        cards[i]=result[i];
    }
}
  
int main(void) {
    int cards[200];
    int i,n,m,k;
 cin>>n>>m;
    for(i=0;i<n*2;i++)cards[i]=i+1;
    for(i=0;i<m;i++) {
        cin>>k;
        if(k==0)rf(cards,n);
        else cut(cards,n,k);
    }
    for(i=0;i<n*2;i++)cout<<cards[i]<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:2: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   32 |  cin>>n>>m;
      |  ^~~
      |  std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:39:23: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   39 |     for(i=0;i<n*2;i++)cout<<cards[i]<<endl;
      |                       ^~~~
      |                       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:39:39: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   39 |     for(i=0;i<n*2;i++)cout<<cards[i]<<endl;
      |                                       ^~~~
      |                                       std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int value[2][201],n,m,x;

int main()
{
 cin>>n>>m;
 for(int i=1;i<=2n;i++) value[0][i]=i;
 for(int i=0;i<m;i++){
  cin>>x;
  if(x==0){
   for(int j=1;j<=2n;j++){
    if(j&1) value[(i+1)&1][j]=value[i&1][j/2+1];
    else value[(i+1)&1][j]=value[i&1][j/2+n];
   }
  else{
    for(int j=1;j<=2*n-k;j++) value[(i+1)&1][j]=value[i&1][k+j];
    for(int j=2*n-k+1;j<=2*n;j++) value[(i+1)&1][j]=value[i&1][j-2*n+k];
   }
  }
 }
 for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: unable to find numeric literal operator 'operator""n'
    9 |  for(int i=1;i<=2n;i++) value[0][i]=i;
      |                 ^~
a.cc:13:19: error: unable to find numeric literal operator 'operator""n'
   13 |    for(int j=1;j<=2n;j++){
      |                   ^~
a.cc:17:3: error: expected '}' before 'else'
   17 |   else{
      |   ^~~~
a.cc:12:11: note: to match this '{'
   12 |   if(x==0){
      |           ^
a.cc:18:24: error: 'k' was not declared in this scope
   18 |     for(int j=1;j<=2*n-k;j++) value[(i+1)&1][j]=value[i&1][k+j];
      |                        ^
a.cc:19:19: error: 'k' was not declared in this scope
   19 |     for(int j=2*n-k+1;j<=2*n;j++) value[(i+1)&1][j]=value[i&1][j-2*n+k];
      |                   ^
a.cc: At global scope:
a.cc:23:2: error: expected unqualified-id before 'for'
   23 |  for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
      |  ^~~
a.cc:23:14: error: 'i' does not name a type
   23 |  for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
      |              ^
a.cc:23:21: error: 'i' does not name a type
   23 |  for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
      |                     ^
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int value[2][201],n,k,x;

int main()
{
 cin>>n>>k;
 for(int i=1;i<=2n;i++) value[0][i]=i;
 for(int i=0;i<k;i++){
  cin>>x;
  if(x==0){
   for(int j=1;j<=2n;j++){
    if(j&1) value[(i+1)&1][j]=value[i&1][j/2+1];
    else value[(i+1)&1][j]=value[i&1][j/2+n];
   }
  else{
    for(int j=1;j<=2*n-x;j++) value[(i+1)&1][j]=value[i&1][x+j];
    for(int j=2*n-x+1;j<=2*n;j++) value[(i+1)&1][j]=value[i&1][j-2*n+x];
   }
  }
 }
 for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: unable to find numeric literal operator 'operator""n'
    9 |  for(int i=1;i<=2n;i++) value[0][i]=i;
      |                 ^~
a.cc:13:19: error: unable to find numeric literal operator 'operator""n'
   13 |    for(int j=1;j<=2n;j++){
      |                   ^~
a.cc:17:3: error: expected '}' before 'else'
   17 |   else{
      |   ^~~~
a.cc:12:11: note: to match this '{'
   12 |   if(x==0){
      |           ^
a.cc: At global scope:
a.cc:23:2: error: expected unqualified-id before 'for'
   23 |  for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
      |  ^~~
a.cc:23:14: error: 'i' does not name a type
   23 |  for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
      |              ^
a.cc:23:21: error: 'i' does not name a type
   23 |  for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
      |                     ^
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int value[2][201],n,k,x;

int main()
{
 cin>>n>>k;
 for(int i=1;i<=2*n;i++) value[0][i]=i;
 for(int i=0;i<k;i++){
  cin>>x;
  if(x==0){
   for(int j=1;j<=2*n;j++){
    if(j&1) value[(i+1)&1][j]=value[i&1][j/2+1];
    else value[(i+1)&1][j]=value[i&1][j/2+n];
   }
  else{
    for(int j=1;j<=2*n-x;j++) value[(i+1)&1][j]=value[i&1][x+j];
    for(int j=2*n-x+1;j<=2*n;j++) value[(i+1)&1][j]=value[i&1][j-2*n+x];
   }
  }
 }
 for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: expected '}' before 'else'
   17 |   else{
      |   ^~~~
a.cc:12:11: note: to match this '{'
   12 |   if(x==0){
      |           ^
a.cc: At global scope:
a.cc:23:2: error: expected unqualified-id before 'for'
   23 |  for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
      |  ^~~
a.cc:23:14: error: 'i' does not name a type
   23 |  for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
      |              ^
a.cc:23:21: error: 'i' does not name a type
   23 |  for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
      |                     ^
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int value[2][201],n,k,x;

int main()
{
 cin>>n>>k;
 for(int i=1;i<=2*n;i++) value[0][i]=i;
 for(int i=0;i<k;i++){
  cin>>x;
  if(x==0){
   for(int j=1;j<=2*n;j++){
    if(j&1) value[(i+1)&1][j]=value[i&1][j/2+1];
    else value[(i+1)&1][j]=value[i&1][j/2+n];
    }
   }
  else{
    for(int j=1;j<=2*n-x;j++) value[(i+1)&1][j]=value[i&1][x+j];
    for(int j=2*n-x+1;j<=2*n;j++) value[(i+1)&1][j]=value[i&1][j-2*n+x];
   }
 }
 for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:38: error: 'm' was not declared in this scope
   23 |  for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
      |                                      ^
Language: C++

#include <iostream>

using namespace std;

int main(){
	int n;  cin >> n;
	int m;  cin >> m;
	int k[1000] = {};
	for(int i = 0; i < m; i++){
		cin >> k[i];
	}

	int num[200]
	for(int i = 0; i < 2 * n; i++){
		num[i] = i + 1;
	}

	for(int i = 0; i < m; i++){
		if(k[i] != 0){
			int shafled[200];
			for(int j = 1; j < 2 * n - k[i]; j++){
				shafled[j - 1] = k[i] + j;	
			}
			for(int j = 0; j < k[i]; j++){
				shafled[j + 2 * n - k[i]] = j + 1	 
			}
			for(int j = 0; j < 2 * n; j++){
				nmu[i] = shafled[i];
			} 
		}else{
			for(int j = 0; j < 2 * n; j += 2){
				int shafled[200];
				shafled[j] = j + 1;
				shafled[j + 1] = n + j + 1;
			}
			for(int j = 0; j < 2 * n; j++){
				nmu[i] = shafled[i];
			} 
		}
	}
	for(int i = 0; i < 2 *n ; i++){
		cout << num[i] << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: expected initializer before 'for'
   14 |         for(int i = 0; i < 2 * n; i++){
      |         ^~~
a.cc:14:24: error: 'i' was not declared in this scope
   14 |         for(int i = 0; i < 2 * n; i++){
      |                        ^
a.cc:25:72: error: expected ';' before '}' token
   25 |                                 shafled[j + 2 * n - k[i]] = j + 1
      |                                                                  ^      
      |                                                                        ;
   26 |                         }
      |                         ~                                         
a.cc:28:33: error: 'nmu' was not declared in this scope
   28 |                                 nmu[i] = shafled[i];
      |                                 ^~~
a.cc:37:33: error: 'nmu' was not declared in this scope
   37 |                                 nmu[i] = shafled[i];
      |                                 ^~~
a.cc:37:42: error: 'shafled' was not declared in this scope
   37 |                                 nmu[i] = shafled[i];
      |                                          ^~~~~~~
a.cc:42:25: error: 'num' was not declared in this scope; did you mean 'enum'?
   42 |                 cout << num[i] << endl;
      |                         ^~~
      |                         enum
Language: C++

#include <iostream>

using namespace std;

int main(){
	int n;  cin >> n;
	int m;  cin >> m;
	int k[1000] = {};
	for(int i = 0; i < m; i++){
		cin >> k[i];
	}

	int num[200];
	for(int i = 0; i < 2 * n; i++){
		num[i] = i + 1;
	}

	for(int i = 0; i < m; i++){
		if(k[i] != 0){
			int shafled[200];
			for(int j = 1; j < 2 * n - k[i]; j++){
				shafled[j - 1] = k[i] + j;	
			}
			for(int j = 0; j < k[i]; j++){
				shafled[j + 2 * n - k[i]] = j + 1	 
			}
			for(int j = 0; j < 2 * n; j++){
				nmu[i] = shafled[i];
			} 
		}else{
			for(int j = 0; j < 2 * n; j += 2){
				int shafled[200];
				shafled[j] = j + 1;
				shafled[j + 1] = n + j + 1;
			}
			for(int j = 0; j < 2 * n; j++){
				nmu[i] = shafled[i];
			} 
		}
	}
	for(int i = 0; i < 2 *n ; i++){
		cout << num[i] << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:72: error: expected ';' before '}' token
   25 |                                 shafled[j + 2 * n - k[i]] = j + 1
      |                                                                  ^      
      |                                                                        ;
   26 |                         }
      |                         ~                                         
a.cc:28:33: error: 'nmu' was not declared in this scope; did you mean 'num'?
   28 |                                 nmu[i] = shafled[i];
      |                                 ^~~
      |                                 num
a.cc:37:33: error: 'nmu' was not declared in this scope; did you mean 'num'?
   37 |                                 nmu[i] = shafled[i];
      |                                 ^~~
      |                                 num
a.cc:37:42: error: 'shafled' was not declared in this scope
   37 |                                 nmu[i] = shafled[i];
      |                                          ^~~~~~~