コードコピーは次のとおりです。
パッケージAirthmatic;
パブリッククラスDEMO10 {
public static void main(string [] args){
double n [] = {9,1.2,5,3.2,1.1};
Ordernum(n);
}
/**
*ダブルおよびint番号のソート
* @param n
*/
public static void ordernum(double [] n){
for(int i = 0; i <n.length-1; i ++){
for(int j = 0; j <n.length-1-i; j ++){
double temp = 0;
if(n [j]> n [j+1]){
temp = n [j+1];
n [j+1] = n [j];
n [j] = temp;
}
}
}
/**
*これが整数を除去する二重タイプです
*/
for(int i = 0; i <n.length; i ++){
int temp =(int)n [i];
if(n [i]%temp == 0){
System.out.println(temp);
}それ以外{
System.out.println(n [i]);
}
}
}
}