package text1;
public class array22 {
public static void main(String[] args) {
int a=8;
int b=6;
int c=1;
if(a>b){
int temp =a;
a=b;
b=temp;
}
if(a>c){
int temp =a;
a=c;
c=temp;
}
if(b>c){
int temp =b;
b=c;
c=temp;
}
System.out.println("a="+a);
System.out.println("b="+b);
System.out.println("c="+c);
}
}
简单的三数排序,由小到大
最新推荐文章于 2023-05-11 09:31:37 发布