crest value &minimum
public class paixu {
public static void main(String[] args) {
double temp;
double num[]={5.1, 7.12, 1.2, 5.21};
for(int i=0; i<3; i++)
for(int k=i+1; k<4; k++)
if(num[i]>num[k])
{
temp=num[i];
num[i]=num[k];
num[k]=temp;
}
System.out.println("最大:"+num[3]+" 最小: "+num[0]);
}
}
posted on 2017-10-27 10:07 MACHINE_001 阅读(77) 评论(0) 编辑 收藏 举报