// Input three numbers from the keyboard and arrange them in ascending order // import Java class for data acquisition. util. role; Class Test2 {public static void main (string [] ARGs) {S = new role (system. in); system. out. println ("Enter three numbers:"); int M1 = S. nextint (); int m2 = S. nextint (); int m3 = S. nextint (); int max = (M1> m2 )? M1 :( m2> m3 )? M2: m3; If (max = m1) {If (M2> m3) {system. out. println (M3 + "\ t" + M2 + "\ t" + M1);} else {system. out. println (M2 + "\ t" + m3 + "\ t" + M1) ;}} else if (max = m2) {If (M1> m3) {system. out. println (M3 + "\ t" + M1 + "\ t" + m2);} else {system. out. println (M1 + "\ t" + m3 + "\ t" + m2);} else {// The condition if (M1> m2) {system. out. println (M2 + "\ t" + M1 + "\ t" + m3);} else {system. out. println (M1 + "\ t" + M2 + "\ t" + m3 );}}}}
This article is from the "First day of course" blog, please be sure to keep this source http://5453607.blog.51cto.com/5443607/1529851