解题思路:
注意事项:
参考代码:
import java.util.Scanner;
public class Main {
public static void Sort(int a,int b,int c){
int temp;
if(a>b){
temp = b;
b = a;
a = temp;
}
if(a>c){
temp = a;
a = c;
c = temp;
}
if(b>c){
temp = b;
b = c;
c = temp;
}
System.out.print(a+" "+b+" "+c+" ");
}
public static void main(String[] arg){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
Sort(a, b, c);
}
}
0.0分
1 人评分