import java.util.Arrays;
公共类测试剥离{
publicstaticvoidmain (stringwxddnargs ) {
stringorignstring=new string (' 5,8,7,4,3,9,1 );
stringwxddnteststring=orign string.split (',';
intwxddntest={ 0,0,0,0,0,0,0 };
//String to int
for(intI=0; i testString.length; I ) {
test [ I ]=integer.parseint (测试字符串[ I ];
}
//sort
Arrays.sort(test );
//asc sort
for(intj=0; j test.length; j ) {
}
//desc
for(intI=(test.Length-1 ); i=0; I---- ) {
}
}
}
import java.util.Arrays;
import Java.util.string tokenizer;
公共类剥离字符串测试{
publicstaticvoidmain (stringwxddnargs ) {
strings=new string (' 5,8,7,4,3,9,1 );
int length=s.length (;
//split s with ','
stringwxddnresult=new string [ commatoker.count tokens (];
int k=0;
while(commatoker.hasmoretokens () ) ) )。
result[k]=commaToker.nextToken (;
k;
}
intwxddna=new int [ result.length ];
for(intI=0; i result.length; I ) {
a [ I ]=integer.parseint (result [ I ];
}
//sort
Arrays.sort(a;
//asc sort
for(intj=0; j result.length; j ) {
}
}
}