package day02;
public class Demo05 {
/*
三个数字排序
*/
public static void main(String[] args) {
System.out.println("三个数字排序,从大到小:");
int a = 2;
int b = 5;
int c = 1;
int t;
if(a < b){
t = a;
a = b;
b = t;
}
if(b < c){
t = b;
b = c;
c = t;
}
if(a < b){
t = a;
a = b;
b = t;
}
System.out.println("a:" + a + " b:" + b + " c:" + c);
}
}
#三个数字排序
a = 2
b = 5
c = 1
if a < b:
a,b = b,a
if b < c:
b,c = c,b
if a < b:
a,b = b,a
print("a:" , a , " b:" , b , " c:" , c)
标签:JAVA,PYTHON,day02.5,System,int,排序,public,out From: https://www.cnblogs.com/zhao02/p/17809625.html