可以直接arr[i] = (int)(Math.xxx);也可以直接arr[bottom++] = (int)(Math.xxx);这多个if 最好换成 if else 或者 switch case;你这多个if必定会多次判断
要是bottom++放到后面就可以用,否则bottom的值+1了不能拿到当前值进行判断