这个程序问题出在哪里?
import java.io.*;
import java.util.*;
/*输入整型数组,输入需排系的数组,创建对象SortArray
调用其排系函数对其排系
public class TextSort
{
public static void main(String[] arg)throws IOException
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s = reader.readLine();
{
String input=JoptionPane.showInputDialog
("How many numbers do you want to sort?");
int n=Integer.parseInt(input);
int[]array=new int[n];
System.out.println("please input the number to be sorted one by one,and each one end with ENTER");
for(i=0;i<n;i++)
{
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s = reader.readLine();
array[i]=Integer.parseInt(s) ;
}
}
Sort SortArray=new sort();
SortArray.QuickSort(array,0,n-1,n);
}
/*类Sort:包含两个函数,通过递归调用和相互调用,实现快排
public class Sort throws IOException
{
public Sort( );
public void QuickSort(int[]L,int first,int last,int number)
{
int n=number;
if(first<last)
{
split=partition(L[],first,last);
for(i=0;i<n;i++)System.out.println(L[i]);
QuickSort(l,first,last,split-1,n);
QuickSort(l,split+1,last,n);
}
return;
}
public int Partition(int L[],int first,int last)
{
left=first;
right=last;
int i=1;
pivot=L[left];
System.out.println
("It's the"+ i+++"time for Partition funtion to be used" );
System.out.println
("the variety value of first and last is :"first","last);
while(left<right)
{
while((right>left)&&(L[right]>=pivot)) right--;
L[left++]=L[right];
while((left<right)&&(L[left]<pivot)) left++;
if(left<last)L[right--]=L[left];
}
System.out.println("the divider's index and value is :"left,L[left]);
L[left]=pivot;
return left;
}
private int pivot;
private int left;
private int right;
}
这个程序编译老出错误,不知道是什么原因
还希望能改进一下程序结构
请多多指教