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

import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int w = scanner.nextInt();
    int n = scanner.nextInt();
    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.parseInt(ab[0]) - 1;
      int b = Integer.perseInt(ab[1]) - 1;
      int temp = values[a];
      values[a] = values[b];
      values[b] = temp;
    }
    for(int i = 0; i < values.length; i ++){
      Sysytem.out.println(values[i]);
    }
  }
}

Compiler output:
Main.java:13: error: cannot find symbol
      String str = sc.next();
                   ^
  symbol:   variable sc
  location: class Main
Main.java:16: error: cannot find symbol
      int b = Integer.perseInt(ab[1]) - 1;
                     ^
  symbol:   method perseInt(String)
  location: class Integer
Main.java:22: error: package Sysytem does not exist
      Sysytem.out.println(values[i]);
             ^
3 errors
Language: Java

import java.util.Scanner;

public class DrowingLots{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int w = scanner.nextInt();
    int n = scanner.nextInt();
    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 = scanner.next();
      String[] ab = str.split(",");
      int a = Integer.parseInt(ab[0]) - 1;
      int b = Integer.parseInt(ab[1]) - 1;
      int temp = values[a];
      values[a] = values[b];
      values[b] = temp;
    }
    for(int i = 0; i < values.length; i ++){
      System.out.println(values[i]);
    }
  }
}

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

import java.util.Scanner;

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

Compiler output:
Main.java:15: error: bad operand types for binary operator '-'
      int a = Integer.parseInt(ab[0] - 1);
                                     ^
  first type:  String
  second type: int
Main.java:16: error: bad operand types for binary operator '-'
      int b = Integer.parseInt(ab[1] - 1);
                                     ^
  first type:  String
  second type: int
2 errors
Language: Java

import java.util.Scanner;

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

    Scanner sc = new Scanner(System.in);
    int w = sc.nextInt();
    int n = sc.nextInt();
    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.parseInt(ab[0]) - 1;
       int b = Integer.parseInt(ab[1]) - 1;
       c = values[a];
       values[a]=values[b];
       values[b]=c;
     }
     for(i = 0; i < n; i ++){
       System.out.println(values[i])
     }
   }
  }

Compiler output:
Main.java:23: error: ';' expected
       System.out.println(values[i])
                                    ^
1 error
Language: Java

import java.util.Scanner;

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

    Scanner sc = new Scanner(System.in);
    int w = sc.nextInt();
    int n = sc.nextInt();
    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.parseInt(ab[0]) - 1;
       int b = Integer.parseInt(ab[1]) - 1;
       c = values[a];
       values[a]=values[b];
       values[b]=c;
     }
     for(i = 0; i < n; i ++){
       System.out.println(values[i]);
     }
   }
  }

Compiler output:
Main.java:18: error: cannot find symbol
       c = values[a];
       ^
  symbol:   variable c
  location: class Main
Main.java:20: error: cannot find symbol
       values[b]=c;
                 ^
  symbol:   variable c
  location: class Main
Main.java:22: error: cannot find symbol
     for(i = 0; i < n; i ++){
         ^
  symbol:   variable i
  location: class Main
Main.java:22: error: cannot find symbol
     for(i = 0; i < n; i ++){
                ^
  symbol:   variable i
  location: class Main
Main.java:22: error: cannot find symbol
     for(i = 0; i < n; i ++){
                       ^
  symbol:   variable i
  location: class Main
Main.java:23: error: cannot find symbol
       System.out.println(values[i]);
                                 ^
  symbol:   variable i
  location: class Main
6 errors
Language: Java

import java.util.Scanner;

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

    Scanner sc = new Scanner(System.in);
    int w = sc.nextInt();
    int n = sc.nextInt();
    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.parseInt(ab[0]) - 1;
       int b = Integer.parseInt(ab[1]) - 1;
       int c = 0;
       c = values[a];
       values[a]=values[b];
       values[b]=c;
     }
     for(i = 0; i < n; i ++){
       System.out.println(values[i]);
     }
   }
  }

Compiler output:
Main.java:23: error: cannot find symbol
     for(i = 0; i < n; i ++){
         ^
  symbol:   variable i
  location: class Main
Main.java:23: error: cannot find symbol
     for(i = 0; i < n; i ++){
                ^
  symbol:   variable i
  location: class Main
Main.java:23: error: cannot find symbol
     for(i = 0; i < n; i ++){
                       ^
  symbol:   variable i
  location: class Main
Main.java:24: error: cannot find symbol
       System.out.println(values[i]);
                                 ^
  symbol:   variable i
  location: class Main
4 errors
Language: Java

import java.util.Scanner; 
 public class Main {
    public static void main(String[] args) {     
         Scanner sc = new Scanner(System.in);
              int w = sc.nextInt();
                int n = sc.nextInt();
                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.parseInt(ab[0]) - 1;
         int b = Integer.parseInt(ab[1]) - 1;
          // a??¨b????????£???values??????????????????
         int j = j;
          values[a]= values[b];
          values[b]= j;     
         }
         // values??????????????????
         for(int i=0;i<values.length; i++){
         	System.out.println(values[i]);
         }   
                                } 
                            } 

Compiler output:
Main.java:17: error: variable j might not have been initialized
         int j = j;
                 ^
1 error
Language: Java

import java.util.Scanner;

public class Main{
    public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int d;
	int w = sc.nextInt();
	int n = sc.nextInt();
	int[] line;
	int[] a;
	line = new int[w];
	a = new int[2];
	for(int i=0;i<w;i++) line[i] = i+1;
	for(int i=0;i<n;i++){
	    String s = sc.next();
	    int l = s.length();
	    int k = 0, f=0, x=0;
	    for(int j=0;j<l;j++){
		 char c = s.charAt(j);
		 if('0' > c || c > '9'){
		     int a[k] = Integer.parseInt(substring(x,j-1));
		     k++;
		     f=0;
		 }else{
		     if(f=0){
			 x=j;
			 f=1;
		     } 
		 }
	    d = line[a[0]];
	    line[a[0]] = line[a[1]];
	    line[a[1]] = d;
	}
	for(int i=0;i<w;i++) System.out.println(line[i]);
    }
}

Compiler output:
Main.java:21: error: ']' expected
		     int a[k] = Integer.parseInt(substring(x,j-1));
		           ^
Main.java:21: error: ';' expected
		     int a[k] = Integer.parseInt(substring(x,j-1));
		            ^
Main.java:36: error: reached end of file while parsing
}
 ^
3 errors
Language: Java

import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int w = sc.nextInt();
		int n = sc.nextInt();
		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[] ab = str.split(",");
			int a = Integer.parseInt(ab[0]) - 1;
			int b = Integer.parseInt(ab[1]) - 1;
			int C = 0;
			C = values[a];
			values[a] = values[b];
			values[b] = C;
		}
		for (int i = 0; i < n + 1; i++) {
			System.out.println(+values[i]);
		}

	}
}

Compiler output:
Main.java:14: error: cannot find symbol
			String[] ab = str.split(",");
			              ^
  symbol:   variable str
  location: class Main
1 error
Language: Java

import java.util.Scanner;

public class DrawingLots {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int w = sc.nextInt();
		int n = sc.nextInt();
		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.parseInt(ab[0]) - 1;
			int b = Integer.parseInt(ab[1]) - 1;
			int c;

			c = values[a];
			values[a] = values[b];
			values[b] = c;
		}
		for (int i = 0; i < values.length; i++) {
			System.out.printf("%d\n", values[i]);
		}
	}
}

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

import java.util.Scanner;

public class StandardDeviation {
 public static <S> void main(String[] args){
  Scanner input=new Scanner(System.in);
  int n ;
  int[] S;
  S=new int[1000];
  double sum,m,k,a;
  
  while((n = input.nextInt())!=0){
   sum=0.0;
   for (int i=0;i<n;i++){
    S[i]=input.nextInt();
   }
   for (int i=0;i<n;i++){
    sum=sum+S[i];
 
   }
  
   m=(double)sum/n;
   k=0.0;
   double u=0.0;
   
   for (int i=0;i<n;i++){
    k=(S[i]-m)*(S[i]-m);
    u=u+k;
   }
   
   a=u/n;
   System.out.println(Math.sqrt(a));
  
  }
 }
}

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


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

class Main{


	public static void main(String[] a){

		Scanner sc = new Scanner(System.in);


		int tatebo = sc.nextInt();
		int yokobo = sc.nextInt();

		int num [] = new int[tatebo];
		for(int i = 0; i < tatebo; i++) {
			num[i] = i + 1;
		}


		for(int i = 0; i < yokobo; i++) {

			String tmp1 = sc.next();
			String tmp2 [] = tmp1.split(",");
			int tmp3 = 0;

			int x = Integer.valueOf(tmp2[0]) - 1;
			int y = Integer.valueOf(tmp2[1]) - 1;


			tmp3 = num[x];
			num[x] = num[y];
			num[y] = tmp3;
		}


		for(int i: num) {

			System.out.println(String.valueOf(i));
		}

	}

Compiler output:
Main.java:47: error: reached end of file while parsing
	}
	 ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

class Main{


	public static void main(String[] a){

		Scanner sc = new Scanner(System.in);


		int tatebo = sc.nextInt();
		int yokobo = sc.nextInt();

		int num [] = new int[tatebo];
		for(int i = 0; i < tatebo; i++) {
			num[i] = i + 1;
		}


		for(int i = 0; i < yokobo; i++) {

			String tmp1 = sc.next();
			String tmp2 [] = tmp1.split(",");
			int tmp3 = 0;

			int x = Integer.valueOf(tmp2[0]) - 1;
			int y = Integer.valueOf(tmp2[1]) - 1;


			tmp3 = num[x];
			num[x] = num[y];
			num[y] = tmp3;
		}


		for(int i: num) {

			System.out.println(String.valueOf(i));
		}

	}

Compiler output:
Main.java:46: error: reached end of file while parsing
	}
	 ^
1 error
Language: Java

/**
 * Drawing Lots
 * (http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0011&lang=jp)
 * 
 * @author ikaruga
 */
class Main {
	public static void main(String[] args) {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in));
			List<String> lines = br.lines().collect(Collectors.toList());
			
			// ?????\??????????????????
			String[] result = proccessAmidakuji(Integer.parseInt(lines.get(0)),
					Integer.parseInt(lines.get(1)),
					lines.stream().skip(2).map(l -> new Yokosen(l.split(",")))
							.collect(Collectors.toList()));

			Stream.of(result).forEach(System.out::println);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * ?????\???????????????????????????
	 * 
	 * @param tatesenNum
	 * @param yokosenNum
	 * @param yokosenList
	 */
	private static String[] proccessAmidakuji(int tatesenNum, int yokosenNum,
			List<Yokosen> yokosenList) {
		String[] result = new String[tatesenNum];

		// ????????°?????????????????????
		for (int tatesenNo = 1; tatesenNo <= tatesenNum; tatesenNo++) {
			int amidaNo = tatesenNo;
			for (Yokosen yokosen : yokosenList) {
				if (yokosen.isContain(amidaNo))
					amidaNo = yokosen.getExchangeNumber(amidaNo);
			}
			result[amidaNo - 1] = String.valueOf(tatesenNo);
		}
		return result;
	}

	/**
	 * ?¨????????????????
	 * 
	 * @author ikaruga
	 */
	static class Yokosen {
		int startNo = 0;
		int endNo = 0;

		public Yokosen(String[] numbers) {
			startNo = Integer.parseInt(numbers[0]);
			endNo = Integer.parseInt(numbers[1]);
		}

		public boolean isContain(int number) {
			return startNo == number || endNo == number;
		}

		public int getExchangeNumber(int number) {
			return startNo + endNo - number;
		}
	}
}

Compiler output:
Main.java:35: error: cannot find symbol
			List<Yokosen> yokosenList) {
			^
  symbol:   class List
  location: class Main
Main.java:10: error: cannot find symbol
			BufferedReader br = new BufferedReader(new InputStreamReader(
			^
  symbol:   class BufferedReader
  location: class Main
Main.java:10: error: cannot find symbol
			BufferedReader br = new BufferedReader(new InputStreamReader(
			                        ^
  symbol:   class BufferedReader
  location: class Main
Main.java:10: error: cannot find symbol
			BufferedReader br = new BufferedReader(new InputStreamReader(
			                                           ^
  symbol:   class InputStreamReader
  location: class Main
Main.java:12: error: cannot find symbol
			List<String> lines = br.lines().collect(Collectors.toList());
			^
  symbol:   class List
  location: class Main
Main.java:12: error: cannot find symbol
			List<String> lines = br.lines().collect(Collectors.toList());
			                                        ^
  symbol:   variable Collectors
  location: class Main
Main.java:18: error: cannot find symbol
							.collect(Collectors.toList()));
							         ^
  symbol:   variable Collectors
  location: class Main
Main.java:20: error: cannot find symbol
			Stream.of(result).forEach(System.out::println);
			^
  symbol:   variable Stream
  location: class Main
8 errors
Language: Java

import java.awt.print.Printable;
import java.util.Scanner;
import javax.sound.midi.SysexMessage;
  
public class Main{      
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int w = sc.nextInt();
        int n = sc.nextInt();
        int amidaArray = new int[n];

        for(int i=0;i<n;i++){
            amidaArray[i] = i;
        }
        for(int i=0;i<w;i++){
            int a = sc.nextInt();
            int b = sc.nextInt();

            int temp = amidaArray[a];

            amidaArray[a]=amidaArray[b];

            amidaArray[b]=temp;
        }
        for(int i=0;i<n;i++){
            System.out.println(amidaArray[i]);
        }
    }   
}


Compiler output:
Main.java:10: error: incompatible types: int[] cannot be converted to int
        int amidaArray = new int[n];
                         ^
Main.java:13: error: array required, but int found
            amidaArray[i] = i;
                      ^
Main.java:19: error: array required, but int found
            int temp = amidaArray[a];
                                 ^
Main.java:21: error: array required, but int found
            amidaArray[a]=amidaArray[b];
                      ^
Main.java:21: error: array required, but int found
            amidaArray[a]=amidaArray[b];
                                    ^
Main.java:23: error: array required, but int found
            amidaArray[b]=temp;
                      ^
Main.java:26: error: array required, but int found
            System.out.println(amidaArray[i]);
                                         ^
7 errors
Language: Java

import java.util.Scanner;
public class Drawing {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            int w = sc.nextInt();
            int n = sc.nextInt();
            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.parseInt(ab[0]) - 1;
                int b = Integer.parseInt(ab[1]) - 1;
                int temp;
                temp=values[a];
                values[a]=values[b];
                values[b]=temp;
                }
            }
            for (int i = 0; i <w; i++) {
                System.out.println(values[i]);
            }
        }
    }

}


Compiler output:
Main.java:28: error: class, interface, enum, or record expected
}
^
1 error
Language: Java

import java.util.Scanner;
public class practice2{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int w = sc.nextInt();
        int n = sc.nextInt();
        int []array=new int [w];
        for(int i=0;i<w;i++)array[i]=i+1;
        int a=0,b=0;
        for(int i=0;i<n;i++){
            String s=sc.next();
            a=s.charAt(0)-'0';
            b=s.charAt(2)-'0';
            int tmp=0;
            tmp=array[a-1];
            array[a-1]=array[b-1];
            array[b-1]=tmp;
        }
        for(int i=0;i<w;i++)System.out.println(array[i]);
    }
}


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


import java.util.Scanner;

public class Main {
    public static void main(Sring[] args){}
    try(Scanner sc = new Scanner ( System.in)){
        int w =sc.nextInt();
        int n =sc.nextInt();
        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 = Integar.parseInt(ab[0])-1;
            int b = Integar.parseInt(ab[1])-1;
            int tmp;
            tmp=values[a];
            values[a]=values[b];
            values[b]=tmp;
        }

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



Compiler output:
Main.java:6: error: illegal start of type
    try(Scanner sc = new Scanner ( System.in)){
    ^
Main.java:6: error: ';' expected
    try(Scanner sc = new Scanner ( System.in)){
                                             ^
2 errors
Language: Java

import java.util.*;
class Main{
 
    public static void main(String args[]){
    int w,n;
    int[][] Edge;
    int[] Ans;
    Scanner in = new Scanner(System.in);
    String[] s;
 
      
    w = in.nextInt();
    n = in.nextInt();
    Edge = new int[w+1][2];
    Ans = new int[w+1];
    for(int i=1;i<=w;i++)Ans[i] = i;
    for(int i=0;i<n;i++){
        s = in.next().split(",");
        Edge[i][0] = Integer.valueOf(s[0]).intValue();
        Edge[i][1] = Integer.valueOf(s[1]).intValue();
        int h = Ans[Edge[i][0]];
        Ans[Edge[i][0]] = Ans[Edge[i][1]];
        Ans[Edge[i][1]] = h;
    }
     
    for(int i=1;i<=w;i++)System.out.println(Ans[i]);
 
    }
 
 
 


Compiler output:
Main.java:28: error: reached end of file while parsing
    }
     ^
1 error
Language: Java

import java.util.Scanner; 
public class Main { 
    public static void main(String[] args) { 
        // 標準入力からデータを読み込む準備 
        try (Scanner sc = new Scanner(System.in)) { 
            int w = sc.nextInt(); 
            int n = sc.nextInt(); 
            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.parseInt(ab[0]) - 1; 
                int b = Integer.parseInt(ab[1]) - 1; 
                int c;
                c = values[a];
                values[a] = value[b];
                values[b] = c;
            } 
            for (int j = 0; j < n; j++){
                System.out.println("%d\n",values[i]);
            } 
        } 
    } 
}



Compiler output:
Main.java:19: error: cannot find symbol
                values[a] = value[b];
                            ^
  symbol:   variable value
  location: class Main
Main.java:23: error: cannot find symbol
                System.out.println("%d\n",values[i]);
                                                 ^
  symbol:   variable i
  location: class Main
Main.java:23: error: no suitable method found for println(String,int)
                System.out.println("%d\n",values[i]);
                          ^
    method PrintStream.println() is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(boolean) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(char) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(int) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(long) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(float) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(double) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(char[]) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(String) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(Object) is not applicable
      (actual and formal argument lists differ in length)
3 errors
Language: Java

import java.util.Scanner; 
public class Main { 
    public static void main(String[] args) { 
        try (Scanner sc = new Scanner(System.in)) { 
            int w = sc.nextInt(); 
            int n = sc.nextInt(); 
            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.parseInt(ab[0]) - 1; 
                int b = Integer.parseInt(ab[1]) - 1; 
                int c;
                c = values[a];
                values[a] = value[b];
                values[b] = c;
            } 
            for (int j = 0; j < n; j++){
                System.out.println("%d\n",values[i]);
            } 
        } 
    } 
}



Compiler output:
Main.java:18: error: cannot find symbol
                values[a] = value[b];
                            ^
  symbol:   variable value
  location: class Main
Main.java:22: error: cannot find symbol
                System.out.println("%d\n",values[i]);
                                                 ^
  symbol:   variable i
  location: class Main
Main.java:22: error: no suitable method found for println(String,int)
                System.out.println("%d\n",values[i]);
                          ^
    method PrintStream.println() is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(boolean) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(char) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(int) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(long) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(float) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(double) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(char[]) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(String) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(Object) is not applicable
      (actual and formal argument lists differ in length)
3 errors
Language: Java

import java.util.Scanner; 
public class Main { 
    public static void main(String[] args) { 
        try (Scanner sc = new Scanner(System.in)) { 
            int w = sc.nextInt(); 
            int n = sc.nextInt(); 
            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.parseInt(ab[0]) - 1; 
                int b = Integer.parseInt(ab[1]) - 1; 
                int c;
                c = values[a];
                values[a] = values[b];
                values[b] = c;
            } 
            for (int j = 0; j < n; j++){
                System.out.println("%d\n",values[i]);
            } 
        } 
    } 
}



Compiler output:
Main.java:22: error: cannot find symbol
                System.out.println("%d\n",values[i]);
                                                 ^
  symbol:   variable i
  location: class Main
Main.java:22: error: no suitable method found for println(String,int)
                System.out.println("%d\n",values[i]);
                          ^
    method PrintStream.println() is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(boolean) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(char) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(int) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(long) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(float) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(double) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(char[]) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(String) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(Object) is not applicable
      (actual and formal argument lists differ in length)
2 errors
Language: Java

import java.util.Scanner; 
public class Main { 
    public static void main(String[] args) { 
        try (Scanner sc = new Scanner(System.in)) { 
            int w = sc.nextInt(); 
            int n = sc.nextInt(); 
            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.parseInt(ab[0]) - 1; 
                int b = Integer.parseInt(ab[1]) - 1; 
                int c=0;
                c = values[a];
                values[a] = values[b];
                values[b] = c;
            } 
            for (int j = 0; j < n; j++){
                System.out.println("%d\n",values[i]);
            } 
        } 
    } 
}



Compiler output:
Main.java:22: error: cannot find symbol
                System.out.println("%d\n",values[i]);
                                                 ^
  symbol:   variable i
  location: class Main
Main.java:22: error: no suitable method found for println(String,int)
                System.out.println("%d\n",values[i]);
                          ^
    method PrintStream.println() is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(boolean) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(char) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(int) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(long) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(float) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(double) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(char[]) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(String) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(Object) is not applicable
      (actual and formal argument lists differ in length)
2 errors
Language: Java

import java.util.Scanner;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int w = sc.nextInt();
        int[] num = new int[w];
        for(int i=0;i<w;i++) num[i] = i + 1;
        int n = sc.nextInt(),a,b,tmp;
        String tmpstr;
        for(int i=0;i<n;i++){
            tmpstr = sc.next();
            /*a = tmpstr.charAt(0) - '0';
            b = tmpstr.charAt(2) - '0';*/
            tmp = num[a-1];
            num[a-1] = num[b-1];
            num[b-1] = tmp;
        }
        for(int i=0;i<w;i++) System.out.println(num[i]);
    }
}



Compiler output:
Main.java:15: error: variable a might not have been initialized
            tmp = num[a-1];
                      ^
Main.java:16: error: variable b might not have been initialized
            num[a-1] = num[b-1];
                           ^
2 errors
Language: Java

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


Compiler output:
Main.java:13: error: bad operand types for binary operator '-'
            a=Integer.parseInt(ab[0]-1);
                                    ^
  first type:  String
  second type: int
Main.java:14: error: bad operand types for binary operator '-'
            b=Integer.parseInt(ab[1]-1);
                                    ^
  first type:  String
  second type: int
2 errors
Language: Java

import java.util.Scanner;
 
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
 
        int[] values = new int[w];
        int w = sc.nextInt();
        int n = sc.nextInt();
 
        stick = 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.parseInt(ab[0])-1;
            int b = Integer.parseInt(ab[1])-1;
 
            int x = values[a];
            values[a] = values[b];
            values[b] = x;
        }
 
        for(int i=0;i<w;i++){
            System.out.println(values[i]);
        }
    }
}



Compiler output:
Main.java:7: error: cannot find symbol
        int[] values = new int[w];
                               ^
  symbol:   variable w
  location: class Main
Main.java:11: error: cannot find symbol
        stick = new int[w];
        ^
  symbol:   variable stick
  location: class Main
2 errors
Language: Java

import java.util.Scanner;
 
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
 
        int[] values = new int[w];
        int w = sc.nextInt();
        int n = sc.nextInt();
 
  
        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.parseInt(ab[0])-1;
            int b = Integer.parseInt(ab[1])-1;
 
            int x = values[a];
            values[a] = values[b];
            values[b] = x;
        }
 
        for(int i=0;i<w;i++){
            System.out.println(values[i]);
        }
    }
}



Compiler output:
Main.java:7: error: cannot find symbol
        int[] values = new int[w];
                               ^
  symbol:   variable w
  location: class Main
1 error
Language: Java

import java.util.Scanner;
 
public class Main {
    public static void main(String[] args){
        try(Scanner sc = new Scanner(System.in)){
 
        
        int w = sc.nextInt();
        int n = sc.nextInt();
        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.parseInt(ab[0])-1;
            int b = Integer.parseInt(ab[1])-1;
 
            int x = values[a];
            values[a] = values[b];
            values[b] = x;
        }
 
        for(int i=0;i<w;i++){
            System.out.println(values[i]);
        }
    }
}



Compiler output:
Main.java:32: error: reached end of file while parsing
}
 ^
1 error
Language: Java

import java.util.Scanner;

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=o;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;
                int value=values[a];
                values[a]=values[b];
                values[b]=values;
            }
            for(int i=0;i<values.length;i++){
                System.out.println(values[i]);
            }
        }
    }
}


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

import java.util.Scanner;

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=o;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;
                int value=values[a];
                values[a]=values[b];
                values[b]=values;
            }
            for(int i=0;i<values.length;i++){
                System.out.println(values[i]);
            }
        }
    }
}


Compiler output:
Main.java:6: error: cannot find symbol
            int w = sc.nextlnt();
                      ^
  symbol:   method nextlnt()
  location: variable sc of type Scanner
Main.java:7: error: cannot find symbol
            int n = sc.nextlnt();
                      ^
  symbol:   method nextlnt()
  location: variable sc of type Scanner
Main.java:12: error: cannot find symbol
            for(int i=o;i<n;i++){
                      ^
  symbol:   variable o
  location: class Main
Main.java:14: error: cannot find symbol
                String[] ab=str.split(regex);
                                      ^
  symbol:   variable regex
  location: class Main
Main.java:19: error: incompatible types: int[] cannot be converted to int
                values[b]=values;
                          ^
5 errors
Language: Java

mport java.util.Scanner;

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=o;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;
                int value=values[a];
                values[a]=values[b];
                values[b]=values;
            }
            for(int i=0;i<values.length;i++){
                System.out.println(values[i]);
            }
        }
    }
}


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
Main.java:14: error: ')' or ',' expected
                String[] ab=str.split(regex: ",");
                                           ^
2 errors
Language: Java

import java.util.Scanner;

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(regex:",");
                int a = Integer.parseInt(ab[0]) - 1;
                int b = Integer.parseInt(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:14: error: ')' or ',' expected
                String[] ab=str.split(regex:",");
                                           ^
1 error
Language: Java

import java.util.Scanner;

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(regex",");
                int a = Integer.parseInt(ab[0]) - 1;
                int b = Integer.parseInt(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:14: error: ')' or ',' expected
                String[] ab=str.split(regex",");
                                           ^
1 error
Language: Java

import java.util.Scanner;

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(regex;",");
                int a = Integer.parseInt(ab[0]) - 1;
                int b = Integer.parseInt(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:14: error: ')' or ',' expected
                String[] ab=str.split(regex;",");
                                           ^
Main.java:14: error: not a statement
                String[] ab=str.split(regex;",");
                                            ^
Main.java:14: error: ';' expected
                String[] ab=str.split(regex;",");
                                               ^
3 errors
Language: Java

import java.util.Scanner;

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(regex):(",");
                int a = Integer.parseInt(ab[0]) - 1;
                int b = Integer.parseInt(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:14: error: ';' expected
                String[] ab=str.split(regex):(",");
                                            ^
1 error
Language: Java

import java.util.Scanner;

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(regex: ",");
                int a = Integer.parseInt(ab[0]) - 1;
                int b = Integer.parseInt(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:14: error: ')' or ',' expected
                String[] ab=str.split(regex: ",");
                                           ^
1 error
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(regex: ",");
                int a = Integer.parseInt(ab[0]) - 1;
                int b = Integer.parseInt(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:12: error: ')' or ',' expected
                String[] ab=str.split(regex: ",");
                                           ^
1 error
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(regex);
                int a = Integer.parseInt(ab[0]) - 1;
                int b = Integer.parseInt(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(regex);
                                      ^
  symbol:   variable regex
  location: class Main
3 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(regex: ",");
                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:12: error: ')' or ',' expected
                String[] ab=str.split(regex: ",");
                                           ^
1 error