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

public class Main {
    public static void main(String[] args){
        try(Scanner sc =new Scanner(System.in)){
            int w = sc.nextlnt();
            int n = sc.nextlnt();
            int[] values = new int[w];
            for(int i=0;i<values.length;i++){
                values[i]=i+1;
            }
            for(int i=0;i<n;i++){
                String str=sc.next();
                String[] ab=str.split;
                int a = Integer.parselnt(ab[0]) - 1;
                int b = Integer.parselnt(ab[1]) - 1;
                int value=values[a];
                values[a]=values[b];
                values[b]=value;
            }
            for(int i=0;i<values.length;i++){
                System.out.println(values[i]);
            }
        }
    }
}


Compiler output:
Main.java:3: error: cannot find symbol
        try(Scanner sc =new Scanner(System.in)){
            ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        try(Scanner sc =new Scanner(System.in)){
                            ^
  symbol:   class Scanner
  location: class Main
Main.java:12: error: cannot find symbol
                String[] ab=str.split;
                               ^
  symbol:   variable split
  location: variable str of type String
Main.java:13: error: cannot find symbol
                int a = Integer.parselnt(ab[0]) - 1;
                               ^
  symbol:   method parselnt(String)
  location: class Integer
Main.java:14: error: cannot find symbol
                int b = Integer.parselnt(ab[1]) - 1;
                               ^
  symbol:   method parselnt(String)
  location: class Integer
5 errors
Language: Java

public class Main {
    public static void main(String[] args){
        try(Scanner sc =new Scanner(System.in)){
            int w = sc.nextlnt();
            int n = sc.nextlnt();
            int[] values = new int[w];
            for(int i=0;i<values.length;i++){
                values[i]=i+1;
            }
            for(int i=0;i<n;i++){
                String str=sc.next();
                String[] ab=str.split(",");
                int a = Integer.parselnt(ab[0]) - 1;
                int b = Integer.parselnt(ab[1]) - 1;
                int value=values[a];
                values[a]=values[b];
                values[b]=value;
            }
            for(int i=0;i<values.length;i++){
                System.out.println(values[i]);
            }
        }
    }
}


Compiler output:
Main.java:3: error: cannot find symbol
        try(Scanner sc =new Scanner(System.in)){
            ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        try(Scanner sc =new Scanner(System.in)){
                            ^
  symbol:   class Scanner
  location: class Main
Main.java:13: error: cannot find symbol
                int a = Integer.parselnt(ab[0]) - 1;
                               ^
  symbol:   method parselnt(String)
  location: class Integer
Main.java:14: error: cannot find symbol
                int b = Integer.parselnt(ab[1]) - 1;
                               ^
  symbol:   method parselnt(String)
  location: class Integer
4 errors
Language: Java

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
//        String code = sc.nextLine();
//        String answer = "";

        int box[] = new int[30];
        String p = "";
        String q = "";
        int x=0;       
        int w  = sc.nextInt();
        int n  = sc.nextInt();
        
        for(int i=0;i<w;i++){
            box[i] = i + 1;
        }

        for(int i=0;i<n;i++){
            String str = sc.next();
            String[] ab = str.split(regex",");

            int a = Integer.parseInt(ab[0]) - 1;
            int b = Integer.parseInt(ab[1]) - 1;
            x = box[a];
            box[a] = box[b];
            box[b] = x;
        }

        for(int i=0;i<w;i++){
            System.out.println(box[i]);
        }

        sc.close();
    }
}


Compiler output:
Main.java:22: error: ')' or ',' expected
            String[] ab = str.split(regex",");
                                         ^
1 error
Language: Java

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int box[] = new int[30];
        String p = "";
        String q = "";
        int x=0;       
        int w  = sc.nextInt();
        int n  = sc.nextInt();
        
        for(int i=0;i<w;i++){
            box[i] = i + 1;
        }

        for(int i=0;i<n;i++){
            String str = sc.next();
            String[] ab = str.split(regex",");

            int a = Integer.parseInt(ab[0]) - 1;
            int b = Integer.parseInt(ab[1]) - 1;
            x = box[a];
            box[a] = box[b];
            box[b] = x;
        }

        for(int i=0;i<w;i++){
            System.out.println(box[i]);
        }

        sc.close();
    }
}


Compiler output:
Main.java:20: error: ')' or ',' expected
            String[] ab = str.split(regex",");
                                         ^
1 error
Language: Java

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int box[] = new int[30];
        int x=0;       
        int w  = sc.nextInt();
        int n  = sc.nextInt();
        
        for(int i=0;i<w;i++){
            box[i] = i + 1;
        }

        for(int i=0;i<n;i++){
            String str = sc.next();
            String[] ab = str.split(regex",");

            int a = Integer.parseInt(ab[0]) - 1;
            int b = Integer.parseInt(ab[1]) - 1;
            x = box[a];
            box[a] = box[b];
            box[b] = x;
        }

        for(int i=0;i<w;i++){
            System.out.println(box[i]);
        }

        sc.close();
    }
}


Compiler output:
Main.java:18: error: ')' or ',' expected
            String[] ab = str.split(regex",");
                                         ^
1 error
Language: Java

import java.util.Scanner;
import java.util.Arrays;

public class a{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int w = sc.nextInt();
        int n = sc.nextInt();
        int[] num = new int[w+1];
        sc.nextLine();
        for(int i=1; i<=w; i++){
            num[i] = i;
        }
        for(int i=0; i<n; i++){
            String[] line = sc.nextLine().split(",",0);
            int a = Integer.parseInt(line[0]);
            int b = Integer.parseInt(line[1]);
            int tmp = num[a];
            num[a] = num[b];
            num[b] = tmp;
        }
        for(int i=1; i<=w; i++){
            System.out.println(num[i]);
        }
    }
}




Compiler output:
Main.java:4: error: class a is public, should be declared in a file named a.java
public class a{
       ^
1 error
Language: Java

import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);
	static int w = Integer.parseInt(sc.nextLine());
	static int[] res = new int[w];
	static int n = Integer.parseInt(sc.nextLine());
	static ArrayList<HorizLine> hL = new ArrayList<HorizLine>();

	public static void main(String[] args) {
		setHorizLine();
		drawLot();
	}

	private static void drawLot() {
		for (int i = 1; i <= w; i++) {
			int p = i;
			for (int j = 0; j < n; j++) {
					if (p == hL.get(j).getPointL() ) {
						p = hL.get(j).getPointR();
					} else if (p == hL.get(j).getPointR()) {
						p = hL.get(j).getPointL();
					}
			}

			res[p - 1] = i;
		}

		for (int i = 0; i < w; i++) {
			System.out.println(res[i]);
		}

	}

	private static void setHorizLine() {
		for (int i = 0; i < n; i++) {
			String[] pt = sc.nextLine().split(",");
			hL.add(new HorizLine( Integer.parseInt(pt[0]), Integer.parseInt(pt[1]) ));
		}

	}

}

public class HorizLine {
	private int pointL;
	private int pointR;

	HorizLine(int pointL, int pointR) {
		this.pointL = pointL;
		this.pointR = pointR;
	}

	public int getPointL() {
		return pointL;
	}
	public int getPointR() {
		return pointR;
	}
	public void setPointL(int pointL) {
		this.pointL = pointL;
	}
	public void setPointR(int pointR) {
		this.pointR = pointR;
	}


}


Compiler output:
Main.java:47: error: class HorizLine is public, should be declared in a file named HorizLine.java
public class HorizLine {
       ^
1 error
Language: Java

import java.util.Scanner;
import java.lang.Math;
import java.math.BigDecimal;

public class DrawingLots{
	
	public static void main(String[] args){

		Scanner s = new Scanner(System.in);
		s.useDelimiter("\\D*");
		
		int w = s.nextInt();
		int n = s.nextInt();
				
		int[] x = new int[w];
		
		for(int i = 0; i < w; i++){
			x[i] = i+1;
		}
		
		for(int i = 0; i < n; i++){
			
			int a = s.nextInt();
			int b = s.nextInt();
			
			int tmp = x[a-1];
			x[a-1] = x[b-1];
			x[b-1] = tmp;
			
		}
		
		for(int i = 0; i < w; i++){
			System.out.println(x[i]);
		}
		
	}
	
}


Compiler output:
Main.java:5: error: class DrawingLots is public, should be declared in a file named DrawingLots.java
public class DrawingLots{
       ^
1 error
Language: Java

import java.util.Scanner;

public class DrawingLots {
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		
		int N = Integer.parseInt(input.nextLine());
		int W = Integer.parseInt(input.nextLine());
		
		int[] v = new int[N];
		
		for(int i = 0; i < N; i++) v[i] = i;
		
		for(int i = 0; i < W; i++) {
			String[] s = input.nextLine().split("[,]");
			int a = Integer.parseInt(s[0]) - 1;
			int b = Integer.parseInt(s[1]) - 1;
			
			int tmp = v[a];
			v[a] = v[b];
			v[b] = tmp;			
		}
		for(int i = 0; i < N; i++) {
			System.out.println(v[i] + 1);			
		}
		System.exit(0);
	}
}

Compiler output:
Main.java:3: error: class DrawingLots is public, should be declared in a file named DrawingLots.java
public class DrawingLots {
       ^
1 error
Language: Java

package p.saburou.aoj

import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	
	private static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		ArrayList<Integer> num = new ArrayList<Integer>();
		ArrayList<Integer> a = new ArrayList<Integer>();
		ArrayList<Integer> b = new ArrayList<Integer>();
		
		initialization(num);
		setInputs(a, b);
		
		swap(num, a, b);
		
		for(int i = 0; i < num.size(); i++){
			System.out.println(num.get(i));
		}
	}
	
	private static void swap(ArrayList<Integer> num, ArrayList<Integer> a, ArrayList<Integer> b){
		if(a.size() == b.size()){
			for(int i = 0; i < a.size(); i++){
				int tmp = num.get(a.get(i) - 1);
				num.set(a.get(i) - 1, num.get(b.get(i) - 1));
				num.set(b.get(i) - 1, tmp);
			}
		}
	}
	
	private static void initialization(ArrayList<Integer> list){
		int n = sc.nextInt();
		for(int i = 0; i < n; i++){
			list.add(i + 1);
		}
	}
	
	private static void setInputs(ArrayList<Integer> from, ArrayList<Integer> to){
		int n = sc.nextInt();
		for(int i = 0; i < n; i++){
			String tmp = sc.next();
			tmp = tmp.substring(0, tmp.length() - 1);
			from.add(Integer.parseInt(tmp));
			to.add(sc.nextInt());
		}
	}
}

Compiler output:
Main.java:1: error: ';' expected
package p.saburou.aoj
                     ^
1 error
Language: Java

import java.util.Scanner;

public class aoj0011
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
			int w = sc.nextInt();
			int n = sc.nextInt();
			int x = 0;
				int[] num = new int[w];
					for(int i=0; i<w; i++)
					{
						num[i] = i+1;
					}
						for(int i=0; i<n; i++)
						{
							String str = sc.next();
								x = num[(int)str.charAt(0)-49];
								num[(int)str.charAt(0)-49] = num[(int)str.charAt(2)-49];
								num[(int)str.charAt(2)-49] = x;
						}
							for(int i=0; i<w; i++)
							{
								System.out.println(num[i]);
							}
	}
}

Compiler output:
Main.java:3: error: class aoj0011 is public, should be declared in a file named aoj0011.java
public class aoj0011
       ^
1 error
Language: Java

import java.util.*;
import java.io.*;

public class AOJ0011 {
    public static void main(String[] args)throws IOException{
        Scanner sc = new Scanner(System.in);
       
            int w = sc.nextInt();
            int[] amida = new int[w+1];
            amida[0]=0;
            for(int i=0; i<=w; i++){
                amida[i] = i; 
            }
            int a,b;
            int temp;
            int n = sc.nextInt();
            for(int i=0; i<n; i++){
                String[] values = sc.nextLine().split(",");
                a = Integer.parseInt(values[0]);
                b = Integer.parseInt(values[1]);
                
                temp = amida[a];
                amida[a] = amida[b];
                amida[b] = temp;
            }
            
            for(int i=1; i<=w; i++){
                System.out.println(amida[i]);
            }
            
        
        
    }
}

Compiler output:
Main.java:4: error: class AOJ0011 is public, should be declared in a file named AOJ0011.java
public class AOJ0011 {
       ^
1 error
Language: Java

import java.io.*;

public class AOJ0011 {
    public static void main(String[] args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
       
            int w = Integer.parseInt(br.readLine());
            int[] amida = new int[w+1];
            amida[0]=0;
            for(int i=0; i<=w; i++){
                amida[i] = i; 
            }
            int a,b;
            int temp;
            int n = Integer.parseInt(br.readLine());
            for(int i=0; i<n; i++){
                String[] values = br.readLine().split(",");
                a = Integer.parseInt(values[0]);
                b = Integer.parseInt(values[1]);
                
                temp = amida[a];
                amida[a] = amida[b];
                amida[b] = temp;
            }
            
            for(int i=1; i<=w; i++){
                System.out.println(amida[i]);
            }
            
        
        
    }
}

Compiler output:
Main.java:3: error: class AOJ0011 is public, should be declared in a file named AOJ0011.java
public class AOJ0011 {
       ^
1 error
Language: Java

#include <stdio.h>
int main(void){
  int w, n, a[31], tmp, x, y, i;
  for(i = 1; i < 31; i++)
    a[i] = i;
  scanf("%d\n%d\n", &w, &n);
  for(;n--;){
    scanf("%d,%d", &x, &y);
    tmp = a[x];
    a[x] = a[y];
    a[y] = tmp;
  }
  for(i = 1; i < w+1; i++)
    printf("%d\n", a[i]);
  return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
         ^
Main.java:4: error: class, interface, enum, or record expected
  for(i = 1; i < 31; i++)
  ^
Main.java:4: error: class, interface, enum, or record expected
  for(i = 1; i < 31; i++)
             ^
Main.java:4: error: class, interface, enum, or record expected
  for(i = 1; i < 31; i++)
                     ^
Main.java:6: error: class, interface, enum, or record expected
  scanf("%d\n%d\n", &w, &n);
  ^
Main.java:7: error: class, interface, enum, or record expected
  for(;n--;){
  ^
Main.java:7: error: class, interface, enum, or record expected
  for(;n--;){
       ^
Main.java:7: error: class, interface, enum, or record expected
  for(;n--;){
           ^
Main.java:9: error: class, interface, enum, or record expected
    tmp = a[x];
    ^
Main.java:10: error: class, interface, enum, or record expected
    a[x] = a[y];
    ^
Main.java:11: error: class, interface, enum, or record expected
    a[y] = tmp;
    ^
Main.java:12: error: class, interface, enum, or record expected
  }
  ^
Main.java:13: error: class, interface, enum, or record expected
  for(i = 1; i < w+1; i++)
             ^
Main.java:13: error: class, interface, enum, or record expected
  for(i = 1; i < w+1; i++)
                      ^
Main.java:15: error: class, interface, enum, or record expected
  return 0;
  ^
Main.java:16: error: class, interface, enum, or record expected
}
^
17 errors
Language: Java

import java.util.Scanner;
public class P0011DrawingLots {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		Scanner scStr=new Scanner(System.in);
		int w=sc.nextInt();
		int[] wArr=new int[w]; 
		for(int i=0;i<w;i++){
			wArr[i]=i+1;
		}
		int n=sc.nextInt();
		for(int i=0;i<n;i++){
			String str=scStr.nextLine();
			String[] ab=str.split(",");
			int a=Integer.parseInt(ab[0])-1;
			int b=Integer.parseInt(ab[1])-1;
			int box=wArr[a];
			wArr[a]=wArr[b];
			wArr[b]=box;
		}
		for(int i=0;i<w;i++){
			System.out.println(wArr[i]);
		}
	}
}

Compiler output:
Main.java:2: error: class P0011DrawingLots is public, should be declared in a file named P0011DrawingLots.java
public class P0011DrawingLots {
       ^
1 error
Language: Java

class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in).useDelimiter("\\D");
        int w = s.nextInt();
        int n = s.nextInt();
        int[] l = new int[w];
        for(int i = 0; i < w; ++i) {
            l[i] = i + 1;
        }
        for(int i = 0; i < n; ++i) {
            int a = s.nextInt();
            int b = s.nextInt();
            int t = l[a - 1];
            l[a - 1] = l[b - 1];
            l[b - 1] = t;
        }
        for(int i : l) {
            System.out.println(i);
        }
    }
}

Compiler output:
Main.java:3: error: cannot find symbol
        Scanner s = new Scanner(System.in).useDelimiter("\\D");
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner s = new Scanner(System.in).useDelimiter("\\D");
                        ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

import java.util.Scanner;
public class Main{
	private static int f;
	private static int s;
	Amida(int first,int second){
		f=first;
		s=second;
	}
	private static void change(int data[]){
		int temp = data[f-1];
		data[f-1] = data[s-1];
		data[s-1] = temp;
	}
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int w = scan.nextInt();
		int n = scan.nextInt();
		int[] data = new int[w];
		for(int i=0;i<w;i++){
			data[i]=i+1;
		}
		int first =0;
		int second =0;
		scan.useDelimiter(",");
		for(int i=0;i<n;i++){
			first = scan.nextInt();
			second = scan.nextInt();
			Amida amida = new Amida(first,second);
			amida.change(data);
		}
		for(int i=0;i<=n;i++)
			System.out.println(data[i]);
	}

}

Compiler output:
Main.java:5: error: invalid method declaration; return type required
	Amida(int first,int second){
	^
1 error
Language: Java

import java.io.*;
import java.uti.*;

public class Main{
	public static void main(String[] args){
		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
		String s,t,u;
		int a,b,hako;
		hako=0;
		String[] abc=new String[2];
		int[] xyz=new int[2];
		try{
			while(true){
				s=reader.readLine();
				t=reader.readLine();
				a=Integer.parseInt(s);
				b=Integer.parseInt(t);
				int[] x=new int[a+1];
				for(int j=1;j<(a+1);j++){
					x[j]=j;
				}
				for(int i=0;i<b;i++){
					u=reader.readLine();
					abc=u.split(",");
					for(int k=0;k<2;k++){
						xyz[k]=Integer.parseInt(abc[k]);
					}
					hako=x[xyz[0]];;
					x[xyz[0]]=x[xyz[1]];
					x[xyz[1]]=hako;
				}
				for(int l=1;l<(a+1);l++){
					System.out.println(x[l]);
				}
				continue;
			}
		}catch(IOException e){
			System.out.println(e);
		}
	}
}

Compiler output:
Main.java:2: error: package java.uti does not exist
import java.uti.*;
^
1 error
Language: C

#include<stdio.h>
int main(){
  int a,b;
  int w,n;
  int x=0;
  int y=0;
  scanf("%d",&w);
  int tate[30]={0};
  for(x=1;x<=w;x++){
    tate[x-1]=x;
  }
  scanf("%d",&n);
  for(x=0;x<n;x++){
    scanf("%d,%d",&a,&b); 
    z=tate[a-1];
    tate[a-1]=tate[b-1];
    tate[b-1]=z;
  }
  for(x=0;x<w;x++){
    printf("%d\n",tate[x]);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:5: error: 'z' undeclared (first use in this function)
   15 |     z=tate[a-1];
      |     ^
main.c:15:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

include<stdio.h>
int main(){
  int w,n,i,tmp1,tmp2,temp;
  int s[33];
  int a,b;
  scanf("%d",&w);
  for(i=0;i<w;i++){
    s[i] = i+1;
  }
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d,%d",&a,&b);
    tmp1 = a;
    tmp2 = b;
    temp = s[tmp1-1];
    s[tmp1-1] = s[tmp2-1];
    s[tmp2-1] = temp;
  }
  for(i=0;i<w;i++){
    printf("%d\n",s[i]);
  }
  return 0;
}
    
    
    

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

#include <stdio.h>

int main(){

 int suuzi[10000];
 int a,j,b,i,n1,n2;

 scanf("%d",&n1);

 for(i=0;i<=n1;i++)suuzi[i]=i;

 scanf("%d",&n2);
 
 for(i=0;i<n2;i++){

 scanf("%d/%d",&a,&b);
 
 for(j=0;j<=n1;j++){

 if(suuzi[j]==a)suuzi[j]=b;
 if(suuzi[j]==b)suuzi[j]=a;




}
 

}

for(i=1;i<=n1)printf("%d/n",suuzi[i]);
return 0;

}

Compiler output:
main.c: In function 'main':
main.c:31:14: error: expected ';' before ')' token
   31 | for(i=1;i<=n1)printf("%d/n",suuzi[i]);
      |              ^
      |              ;
Language: C

#include <stdio.h>
#define NUM 50

void swap(int *a, int *b line[]){

int temp=line[a-1];
line[a-1]=line[b-1];
line[b-1]=temp;

}

int main(void){

int i, w, n;
int a, b;
int line[NUM]

scanf("%d", &w);
scanf("%d", &n);

for(i=0; i<w; i++)
line[i]=i+1;

for(i=0; i<n; i++)
scanf("%d,%d", &a, &b);
swap(&a, &b, line);

for(i=0; i<w; i++){
printf("%d", line[i]);
putchar('\n');

return 0;

}

Compiler output:
main.c:4:26: error: expected ';', ',' or ')' before 'line'
    4 | void swap(int *a, int *b line[]){
      |                          ^~~~
main.c: In function 'main':
main.c:18:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf'
   18 | scanf("%d", &w);
      | ^~~~~
main.c:22:1: error: 'line' undeclared (first use in this function)
   22 | line[i]=i+1;
      | ^~~~
main.c:22:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:26:1: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
   26 | swap(&a, &b, line);
      | ^~~~
main.c:34:1: error: expected declaration or statement at end of input
   34 | }
      | ^
Language: C

#include <stdio.h>
#define NUM 50
 
void swap(int *a, int *b int line[]){
 
int temp=line[a-1];
line[a-1]=line[b-1];
line[b-1]=temp;
 
}
 
int main(void){
 
int i, w, n;
int a, b;
int line[NUM]
 
scanf("%d", &w);
scanf("%d", &n);
 
for(i=0; i<w; i++)
line[i]=i+1;
 
for(i=0; i<n; i++){
scanf("%d,%d", &a, &b);
swap(&a, &b, line);
}
 
for(i=0; i<w; i++){
printf("%d", line[i]);
putchar('\n');
}
 
return 0;
 
}

Compiler output:
main.c:4:26: error: expected ';', ',' or ')' before 'int'
    4 | void swap(int *a, int *b int line[]){
      |                          ^~~
main.c: In function 'main':
main.c:18:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf'
   18 | scanf("%d", &w);
      | ^~~~~
main.c:22:1: error: 'line' undeclared (first use in this function)
   22 | line[i]=i+1;
      | ^~~~
main.c:22:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:26:1: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
   26 | swap(&a, &b, line);
      | ^~~~
Language: C

#include<stdio.h>

int main (void){
	
	int amida[30]={0};
	int ans[30]={30};
	int w,n,i,j,a,b,t;
	int a[30]={0},b[30]={0};
	
	scanf("%d",&w);
	scanf("%d",&n);
	
	for(j=1;j<=n;j++){
		scanf("%d,%d",&a[j],&b[j]);
	}
	
	for(i=1;i<=w;i++){
		t = i;
		for(j=1;j<=n;j++){
			if(i==a[j]){
				i = b[j];
				//printf("a[j] OK %d\n",i);
			}else if(i==b[j]){
				i = a[j];
				//printf("b[j] OK %d\n",i);
			}else{
				;
			}
			//printf("i?????????%d\n",i);
		}
		
		ans[i] = t;
		i = t;
	}
	
	for(i=1;i<=w;i++){
		printf("%d\n",ans[i]);
	}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:13: error: conflicting types for 'a'; have 'int[30]'
    8 |         int a[30]={0},b[30]={0};
      |             ^
main.c:7:21: note: previous declaration of 'a' with type 'int'
    7 |         int w,n,i,j,a,b,t;
      |                     ^
main.c:8:23: error: conflicting types for 'b'; have 'int[30]'
    8 |         int a[30]={0},b[30]={0};
      |                       ^
main.c:7:23: note: previous declaration of 'b' with type 'int'
    7 |         int w,n,i,j,a,b,t;
      |                       ^
Language: C

#include <cstdio>

inline void swap(int array[], int a, int b) {
	int c = array[a];
	array[a] = array[b];
	array[b] = c;
}

int main() {
	int array[50];
	int w, n, a, b;

	for (int i = 0; i<50; i++) {
		array[i] = i;
	}

	scanf("%d", &w);
	scanf("%d", &n);
	for (int i = 0; i<n; i++) {
		scanf("%d,%d", &a, &b);
		swap(array, a, b);
	}
	for (int i = 1; i <= w; i++) {
		printf("%d\n", array[i]);
	}
}

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

#include <stdio.h>

int main()
{
  int w, n;
  int a, b;
  int ans[31];
  int i, tmp;

  scanf("%d", &w);
  scanf("%d", &n);

  for(i = 0; i < w; i++)
    ans[i] = i+1;

  for(i = 0; i < n; i++){
    scanf("%d,%d", &a, &b);

    tmp = ans[a-1];
    l[a-1] = l[b-1];
    l[b-1] = tmp;
  }

  for(i = 0; i < w; i++)
    printf("%d\n", l[i]);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:5: error: 'l' undeclared (first use in this function)
   20 |     l[a-1] = l[b-1];
      |     ^
main.c:20:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

clude<stdio.h>

int main(){

	int w;		//???????????¬??°
	int n;		//?¨??£??????¬??°
	int a[32];	//???????????????
	int i,x,y,temp;

	// ???????¨??£??????°?????\???????????????

	scanf("%d", &w);  
		if ((w < 0) || (w >= 30)) {
            printf("30?????§?????´??°????????\?????????????????????\n\a");
            continue;
		}
		scanf("%d", &n) ;
			if ((n < 0) || (n >= 30)) {
        	    printf("30?????§?????´??°????????\?????????????????????\n\a");
        	    continue;
			}
		for(i=1; i<=w; i++){
			a[i] = i;
		}

		//?????????????????\???????????????
		for(i=1; i<=n; i++){
			scanf("%d,%d",&x,&y);
				temp = a[x];
				a[x] = a[y];
				a[y] = temp;
				
		}

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

Compiler output:
main.c:1:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | clude<stdio.h>
      |      ^
Language: C

include<stdio.h>

int main(){

	int w;		//???????????¬??°
	int n;		//?¨??£??????¬??°
	int a[32];	//???????????????
	int i,x,y,temp;

	// ???????¨??£??????°?????\???????????????

	scanf("%d", &w);  
		if ((w < 0) || (w >= 30)) {
            printf("30?????§?????´??°????????\?????????????????????\n\a");
            continue;
		}
		scanf("%d", &n) ;
			if ((n < 0) || (n >= 30)) {
        	    printf("30?????§?????´??°????????\?????????????????????\n\a");
        	    continue;
			}
		for(i=1; i<=w; i++){
			a[i] = i;
		}

		//?????????????????\???????????????
		for(i=1; i<=n; i++){
			scanf("%d,%d",&x,&y);
				temp = a[x];
				a[x] = a[y];
				a[y] = temp;
				
		}

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

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

#include<stdio.h>
int main(){
int w,n,i;
scanf("%d",&w);
scanf("%d",&n);
int l[w];
for(i=0;i<w;i++){
l[i]=i;
}
for(i=0;i<n;i++){
int a,b,t;
scanf("%d,%d",&a,&b);
t=l[a-1];
l[a-1]=l[b-1];
l[b-1]=t;
}
for(i=0;i<w;i++){
printf("%d\n",l[i]+1);
}
return 0;
}#include<stdio.h>
int main(){
int w,n,i;
scanf("%d",&w);
scanf("%d",&n);
int l[w];
for(i=0;i<w;i++){
l[i]=i;
}
for(i=0;i<n;i++){
int a,b,t;
scanf("%d,%d",&a,&b);
t=l[a-1];
l[a-1]=l[b-1];
l[b-1]=t;
}
for(i=0;i<w;i++){
printf("%d\n",l[i]+1);
}
return 0;
}

Compiler output:
main.c:21:2: error: stray '#' in program
   21 | }#include<stdio.h>
      |  ^
main.c:21:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   21 | }#include<stdio.h>
      |          ^
Language: C

#include<stdio.h>

int main()
{
   int w, n, i, a, b, tmp;
   scanf("%d %d", &w, &n);
   int R[w];

   for(i=0; i<n; i++){
      scanf("%d,%d", &a, &b);
      int R[a], R[b];
      tmp = R[a];
      R[a] = R[b];
      R[b] = tmp;
   }

   for(i=0; i<w; i++){
      printf("%d\n", R[w]);
   }

   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:17: error: redeclaration of 'R' with no linkage
   11 |       int R[a], R[b];
      |                 ^
main.c:11:11: note: previous declaration of 'R' with type 'int[a]'
   11 |       int R[a], R[b];
      |           ^
Language: C

#include<stdio.h>

int main()
{
   int w, n, i, a, b, tmp;
   scanf("%d %d", &w, &n);
   int R[w];

   for(i=0; i<n; i++){
      scanf("%d %d", &a, &b);
      int R[a], R[b];
      tmp = R[a];
      R[a] = R[b];
      R[b] = tmp;
   }

   for(i=0; i<w; i++){
      printf("%d\n", R[w]);
   }

   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:17: error: redeclaration of 'R' with no linkage
   11 |       int R[a], R[b];
      |                 ^
main.c:11:11: note: previous declaration of 'R' with type 'int[a]'
   11 |       int R[a], R[b];
      |           ^
Language: C

#include<stdio.h>

int main()
{
   int w, n, i, a, b, tmp;
   scanf("%d %d", &w, &n);
   int R[w];

   for(i=1; i<=w; i++){
      scanf("%d", &R[i]);
   }

   for(i=1; i<=n; i++){
      scanf("%d %d", &a, &b);
      int R[a], R[b];
      tmp = R[a];
      R[a] = R[b];
      R[b] = tmp;
   }

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

   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:17: error: redeclaration of 'R' with no linkage
   15 |       int R[a], R[b];
      |                 ^
main.c:15:11: note: previous declaration of 'R' with type 'int[a]'
   15 |       int R[a], R[b];
      |           ^
Language: C

a,b,i,j;main(w,*x){for(scanf("%d%*d",&w);i++<w;)x[i]=i;for(;~scanf("%d,%d",&a,&b);x[b]=i)i=x[a],x[a]=x[b];for(;j++<w;)printf("%d\n",x[j]);exit(0);}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | a,b,i,j;main(w,*x){for(scanf("%d%*d",&w);i++<w;)x[i]=i;for(;~scanf("%d,%d",&a,&b);x[b]=i)i=x[a],x[a]=x[b];for(;j++<w;)printf("%d\n",x[j]);exit(0);}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
    1 | a,b,i,j;main(w,*x){for(scanf("%d%*d",&w);i++<w;)x[i]=i;for(;~scanf("%d,%d",&a,&b);x[b]=i)i=x[a],x[a]=x[b];for(;j++<w;)printf("%d\n",x[j]);exit(0);}
      |   ^
main.c:1:5: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
    1 | a,b,i,j;main(w,*x){for(scanf("%d%*d",&w);i++<w;)x[i]=i;for(;~scanf("%d,%d",&a,&b);x[b]=i)i=x[a],x[a]=x[b];for(;j++<w;)printf("%d\n",x[j]);exit(0);}
      |     ^
main.c:1:7: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int]
    1 | a,b,i,j;main(w,*x){for(scanf("%d%*d",&w);i++<w;)x[i]=i;for(;~scanf("%d,%d",&a,&b);x[b]=i)i=x[a],x[a]=x[b];for(;j++<w;)printf("%d\n",x[j]);exit(0);}
      |       ^
main.c:1:16: error: expected ')' before '*' token
    1 | a,b,i,j;main(w,*x){for(scanf("%d%*d",&w);i++<w;)x[i]=i;for(;~scanf("%d,%d",&a,&b);x[b]=i)i=x[a],x[a]=x[b];for(;j++<w;)printf("%d\n",x[j]);exit(0);}
      |                ^
      |                )
Language: C

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

int i,j,k,w,n,x,y,z,ans[50];

int main(){
	scanf("%d",&w);
	for(i=1;i<=w;i++)ans[i]=i;
	scanf("\n%d",&n);
	for(i=0;i<n;i++){
		scanf("\n%d,%d",&x,&y);
		z=ans[x]
		ans[x]=ans[y];
		ans[y]=z;
	}
	for(i=1;i<=w;i++)printf("%d\n",ans[i]);
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:25: error: expected ';' before 'ans'
   13 |                 z=ans[x]
      |                         ^
      |                         ;
   14 |                 ans[x]=ans[y];
      |                 ~~~
Language: C

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

// Drawing Lots

int wires[31];

void swap(int nth, int mth){
  int tmp;
  tmp = wires[nth];
  wires[nth] = wires[mth];
  wires[mth] = tmp;
  return;
}

int main(){
  int w;
  int n;
  int i;
  int a, b;

  scanf("%i", &w);
  for (i=1; i<=w;i++){
    wires[i] = i;
  }

  scanf("%i", &n);
  for (i = 0; i<n ;i++){
    scanf("%d,%d", &a, &b);
    swap(a, b);
  }


  for (i=1; i<=w;i++){
    printf("%d\n", wires[i]);
  }
  return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c: In function 'main':
main.c:22:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   22 |   scanf("%i", &w);
      |   ^~~~~
main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    2 | #include<math.h>
  +++ |+#include <stdio.h>
    3 | 
main.c:22:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   22 |   scanf("%i", &w);
      |   ^~~~~
main.c:22:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:35:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   35 |     printf("%d\n", wires[i]);
      |     ^~~~~~
main.c:35:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:35:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:35:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>
  int main(){
   int w,h,i;
    int x[31],y[31];
    for(i=1;i<=w;i++){
      x[i]=i;
       }
      for(i=0;i<h;i++){
        scanf("%d%d",&a,&b);
         x[a]=b;
         x[b]=a;
           }
  for(i=1;i<=w;i++){
printf("%d\n",x[i]);
}
return 0;
}         

Compiler output:
main.c: In function 'main':
main.c:9:23: error: 'a' undeclared (first use in this function)
    9 |         scanf("%d%d",&a,&b);
      |                       ^
main.c:9:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:26: error: 'b' undeclared (first use in this function)
    9 |         scanf("%d%d",&a,&b);
      |                          ^
Language: C

#include<iostream>
using namespace std;
 int num[31];
void swap(int a,int b){
  int c = num[a];
  num[a]=num[b];
  num[b]=c;
  

}


int main(){
  int w,n,a,b;
  //  int num[31]={0};
  // cin>>w>>n;
  scanf("%d",&w);
  scanf("%d",&n);
 
  for(int i=1;i<=w;i++){
    num[i]=i;
  }
  for(int i=1;i<=n;i++){
    scanf("%d,%d",&a,&b);
    swap(a,b);
  }
  for(int i=1;i<=w;i++){
    //cout<<num[i]<<endl;
    printf("%d\n",num[i]);
  }
  // cout<<a<<b;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

include <stdio.h>
#define MAX 30


int main(void){
  int n,m,b,a,i,box[MAX+1],tmp;
  char comma;

  scanf("%d %d" ,&n ,&m);

  for( i = 0 ; i < n ; i++ ) box[i+1] = i+1;

  for( i = 0 ; i < m ; i++ ){
    scanf("%d %c %d" ,&b ,&comma ,&a );
    tmp = box[b];
    box[b] = box[a];
    box[a] = tmp;
  }

  for( i = 0 ; i < n ; i++ ) printf("%d\n" ,box[i+1]);


  return 0;
}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C

#include<stdio.h>

int main(){
	int w, n, a, b, i, store, s[30];
	for(i = 0; i < 30; i++) s[i] = i + 1;
	scanf("%d", &w);
	scanf("%d", &n);
	for(i = 0; i < n; i++){
		scanf("%d,%d" &a, &b);
		store = s[a - 1];
		s[a - 1] = s[b - 1];
		s[b - 1] = store;
	}
	for(i = 0; i < w; i++) printf("%d\n", s[i]);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:31: error: invalid operands to binary & (have 'char *' and 'int')
    9 |                 scanf("%d,%d" &a, &b);
      |                       ~~~~~~~ ^
      |                       |
      |                       char *
Language: C

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


int main(){
  int w,n,h,i;
  
  scanf("%d\n",&w);
  scanf("%d\n",&n);

  int a[],b[];
  int c[];

  for(i=0;n>i;++1){
    scanf("%d,%d\n",&a[i],&b[i]);
  }
  for(i=1;w>=i;++i){
    i=c[i];
  }
   
  for(i=0;n>i;++i){
    h=c[b[i]];
    c[b[i]]=c[a[i]];
    c[a[i]]=h;
  }
  for(i=0;w>i;++i){
    printf("%d",c[i]);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:7: error: array size missing in 'a'
   11 |   int a[],b[];
      |       ^
main.c:11:11: error: array size missing in 'b'
   11 |   int a[],b[];
      |           ^
main.c:12:7: error: array size missing in 'c'
   12 |   int c[];
      |       ^
main.c:14:15: error: lvalue required as increment operand
   14 |   for(i=0;n>i;++1){
      |               ^~
Language: C

#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
  int w,n;
  cin>>w>>n;
  vector<int>a(w);
  for(int i=0;i<w;i++)a[i]=i+1;

  for(int i=0;i<n;i++){
    int b,c;
    char d;
    cin>>b>>d>>c;
    swap(a[b-1],a[c-1]);
  }
  for(int i=0;i<w;i++)cout<<a[i]<<endl;

}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
int main(){

	int w,n,a[31];
	
	scanf("%d",&w);
	for(i=0;i<w;i++){
		a[i]=i+1;
	}
	scanf("%d",&n);
	for(i=0,i<n;i++){
		scanf("%d,%d",&c1,&c2);
		t=a[c1];
		a[c1]=a[c2];
		a[c2]=t;
	}
	for(i=0;i<w;i++){
		printf("%d\n",a[i];);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:13: error: 'i' undeclared (first use in this function)
    7 |         for(i=0;i<w;i++){
      |             ^
main.c:7:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:24: error: expected ';' before ')' token
   11 |         for(i=0,i<n;i++){
      |                        ^
      |                        ;
main.c:12:32: error: 'c1' undeclared (first use in this function)
   12 |                 scanf("%d,%d",&c1,&c2);
      |                                ^~
main.c:12:36: error: 'c2' undeclared (first use in this function)
   12 |                 scanf("%d,%d",&c1,&c2);
      |                                    ^~
main.c:13:17: error: 't' undeclared (first use in this function)
   13 |                 t=a[c1];
      |                 ^
main.c:18:35: error: expected ')' before ';' token
   18 |                 printf("%d\n",a[i];);
      |                       ~           ^
      |                                   )
Language: C

#include<stdio.h>
int main(){

	int w,n,a[31];
	
	scanf("%d",&w);
	for(i=0;i<w;i++){
		a[i]=i+1;
	}
	scanf("%d",&n);
	for(i=0,i<n;i++){
		scanf("%d,%d",&c1,&c2);
		t=a[c1];
		a[c1]=a[c2];
		a[c2]=t;
	}
	for(i=0;i<w;i++){
		printf("%d\n",a[i]);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:13: error: 'i' undeclared (first use in this function)
    7 |         for(i=0;i<w;i++){
      |             ^
main.c:7:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:24: error: expected ';' before ')' token
   11 |         for(i=0,i<n;i++){
      |                        ^
      |                        ;
main.c:12:32: error: 'c1' undeclared (first use in this function)
   12 |                 scanf("%d,%d",&c1,&c2);
      |                                ^~
main.c:12:36: error: 'c2' undeclared (first use in this function)
   12 |                 scanf("%d,%d",&c1,&c2);
      |                                    ^~
main.c:13:17: error: 't' undeclared (first use in this function)
   13 |                 t=a[c1];
      |                 ^
Language: C

#include<stdio.h>
int main(){

	int w,n,a[31];
	int i,c1,c2,t;
	scanf("%d",&w);
	for(i=0;i<w;i++){
		a[i]=i+1;
	}
	scanf("%d",&n);
	for(i=0,i<n;i++){
		scanf("%d,%d",&c1,&c2);
		t=a[c1];
		a[c1]=a[c2];
		a[c2]=t;
	}
	for(i=0;i<w;i++){
		printf("%d\n",a[i]);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:24: error: expected ';' before ')' token
   11 |         for(i=0,i<n;i++){
      |                        ^
      |                        ;
Language: C++

#include<iostream>
using namespace std;
int n;
int a[1000000];
int sum[1000000];
int main(int argc, char const *argv[])
{

	int tc[30];
	cin>>tc[30];
	int w,v;
	for (int i = 0; i < 30; ++i) tc[i] = i+1;
		for (int i = 0; i < v; ++i)
		{
			int a,b;
			cin>>a>>b;
			int c=tc[a-1];
			tc[a-1]=tc[b-1];
			tc[b-1];

		}
		for (int i = 0; i < a; ++i)
		{
			cout<<t[i]<<endl;
		}
		
		
			
		
	    		
}
	
	

	




Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:22:35: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   22 |                 for (int i = 0; i < a; ++i)
      |                                 ~~^~~
a.cc:24:31: error: 't' was not declared in this scope
   24 |                         cout<<t[i]<<endl;
      |                               ^
Language: C++

#include<iostream>
using namespace std;
int n;
int a[1000000];
int sum[1000000];
int main(int argc, char const *argv[])
{

	int tc[30];
	cin>>tc[30];
	int w,v;
	for (int i = 0; i < 30; ++i) tc[i] = i+1;
		for (int i = 0; i < v; ++i)
		{
			int a,b;
			cin>>a>>b;
			int c=tc[a-1];
			tc[a-1]=tc[b-1];
			tc[b-1];

		}
		for (int i = 0; i < strlen(a); ++i)
		
			cout<<t[i]<<endl;
		
		
		
			
		
	    		
}
	
	

	




Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:22:37: error: 'strlen' was not declared in this scope
   22 |                 for (int i = 0; i < strlen(a); ++i)
      |                                     ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
a.cc:24:31: error: 't' was not declared in this scope
   24 |                         cout<<t[i]<<endl;
      |                               ^
Language: C++

import java.io.*;
import java.util.*;
public class Main{
	public static void main(String[] args)throws IOException{
		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
		//Scanner reader=new Scanner(System.in);
		String s=reader.readLine();
		int in=Integer.parseInt(s);
		//int in=reader.nextInt();
		int[] out=new int[in];
		for(int i=1;i<=in;i++)out[i-1]=i;
		//in=reader.nextInt();
		s=reader.readLine();
		in=Integer.parseInt(s);
		for(int i=0;i<in;i++){
			String s1=reader.readLine();
			String[] in1=s1.split(",");
			int a=Integer.parseInt(in1[0]);
			int b=Integer.parseInt(in1[1]);
			int tmp=out[a-1];
			out[a-1]=out[b-1];
			out[b-1]=tmp;
		}
		for(int i=0;i<out.length;i++)System.out.println(out[i]);
	}
}

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

#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
typedef long long int LLI;
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  int n,m;
  char d;
  cin>>n>>m;
  vector<int>out(n);
  rep(i,n)out[i]=i+1;
  rep(i,m){
    int a,b;
    cin>>a>>d>x>b;
    swap(out[a-1],out[b-1]);
  }
  rep(i,n)cout<<out[i]<<endl;
}

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

#include<iostream>
using namespace std;

int main()
{
 int x[30];
 int w, n;
 
 cin >> w >> n;
 for(int i=0; i<w; i++) x[i] = i+1;

 int a, b;
 for(int i=0; i<n; i++){
  cin  >> a >> b;
  int tmp = x[a];
  x[a] = x[b];
  x[b] = tmp;
 }

 for(int i=0; i<w; i++){
  cout << x[i];
  if(i == w-1) break;;
  cout << '\n';
}

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

#include<iostream>
using namespace std;

int main()
{
 int x[30];
 int w, n;
 
 cin >> w >> n;
 for(int i=0; i<w; i++) x[i] = i+1;

 int a, b;
 for(int i=0; i<n; i++){
  cin  >> a >> b;
  int tmp = x[a];
  x[a] = x[b];
  x[b] = tmp;
 }

 for(int i=0; i<w; i++){
  cout << x[i];
  if(i == w-1) break;
  cout << '\n';
}

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

#include <iostream>
#include <iomanip>
#include <sstream>
#include <stdio.h>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <math.h>
#include <utility>
#include <string>
#include <ctype.h>
#include <cstring>
#include <cstdio>
#include <sstream>
using namespace std;

#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define INF 114514810
#define ll long long
#define scanf scanf_s

int w, n;
int ban[35];
int main()
{
	REP(i, 35) ban[i] = i;
	cin >> w >> n;
	REP(i, n)
	{
		int a, b;
		scanf("%d,%d", &a, &b);
		swap(ban[a], ban[b]);
	}
	FOR(i,1, w+1) cout << ban[i] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   22 | #define scanf scanf_s
      |               ^~~~~~~
a.cc:33:17: note: in expansion of macro 'scanf'
   33 |                 scanf("%d,%d", &a, &b);
      |                 ^~~~~
Language: C++

#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
#include <map>
#include <fstream>
#include <array>
#include <utility>
#include <functional>
using namespace std;
typedef long long Int;
#define REP(i , x) for(int i = 0 ; i < x ; ++i)

typedef pair<int, int> P;

int dp[60];

int main()
{
	int w(0),n(0);
	REP(i, 60){
		dp[i] = i;
	}
	cin >> n >> w;
	REP(i, w){
		int a, b;
		char c;
		scanf_s("%d,%d", &a,&b);
		swap(dp[a], dp[b]);
	}
	REP(i, n){
		cout << dp[i+1] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   29 |                 scanf_s("%d,%d", &a,&b);
      |                 ^~~~~~~
      |                 scanf
Language: C++

#include <iostream>
using namespace std;


int main(){
  int verticals,horizontals,a,b;
  char commma; //commaを抜くための変数
  cin >> verticals;
  cin >> horizontals;

  int res[verticals];
  for(int i=0;i<verticals;i++) res[i] = i+1;
  for(int i=0;i<horizontals;i++){
    cin >> a >> comma >> b;   
    int tmp = res[a-1];
    res[a-1] = res[b-1];
    res[b-1] = tmp;
  }
  for(int i=0;i<verticals;i++) cout << res[i] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'comma' was not declared in this scope; did you mean 'commma'?
   14 |     cin >> a >> comma >> b;
      |                 ^~~~~
      |                 commma
Language: C++

#include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;
void getValues(string& s, int& a, int & b)
{
	string::size_type p = s.find(',');
	string sa = s.substr(0, p);
	string sb = s.substr(p + 1);
	a = atoi(sa.c_str());
	b = atoi(sb.c_str());
}

int main()
{
	int w, n, a, b;
	cin >> w >> n;
	int W[31] = {};
	FOR(i, 1, w + 1) W[i] = i;
	string line;
	while (n--){
		cin >> line;
		getValues(line, a, b);
		swap(W[a], W[b]);
	}
	FOR(i, 1, w + 1) cout << W[i] << "\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: 'i' was not declared in this scope
   19 |         FOR(i, 1, w + 1) W[i] = i;
      |             ^
a.cc:19:9: error: 'FOR' was not declared in this scope
   19 |         FOR(i, 1, w + 1) W[i] = i;
      |         ^~~