把数组按照奇先偶后排序
package simple;
//奇先偶后排序
public class QFirst {
public static void main(String[] args) {
int [] arr = {4,1,3,1,2,3,6,7,8,9,67};
int i=0,j=arr.length-1;
while (i<j){
if ((arr[i]&1)==1){//奇数
i++;
}else {
int temp = arr[i];
arr[i]=arr[j];
arr[j]=temp;
j--;
}
}
for (int val:arr){
System.out.println(val);
}
}
}