/* * 要更改此模板,请选择工具 | 模板 * 并在编辑器中打开模板。*/ 包 geeksforgeeks;
/** * *
/ 导入 java.util. ;
公共类 unique_char {
/**
* @param args the command line arguments
*/
public static void quicksort(char array[], int p, int r)
{
System.out.println("hello");
if(r - p < 1)
return;
int pivot = p;
int i = p + 1;
int j = r;
while(i < j)
{
while(array[i] > array[p] && i < r)
i++;
while(array[j] > array[p] && j > p)
j--;
if(i < j)
swap(array,i,j);
}
swap(array,pivot,j);
quicksort(array,p,j-1);
quicksort(array,j+1,r);
}
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
char line[] = sc.nextLine().toCharArray();
quicksort(line,0,line.length-1);
//System.out.print(line);
for(int i=0; i<line.length-1; i++)
{
if(line[i] == line[i+1])
System.out.println("string dont have all char unique");
break;
}
}
private static void swap(char[] array, int pivot, int j)
{
char t = array[pivot];
array[pivot] = array[j];
array[j] = t;
//throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
}