AcWing 663. 简单排序 - Java
原题链接
中等
作者:
KYCygni
,
2021-03-12 05:20:03
,
所有人可见
,
阅读 303
Java 代码
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner cin = new Scanner(System.in);
int x = cin.nextInt();
int y = cin.nextInt();
int z = cin.nextInt();
int a = x;
int b = y;
int c = z;
if (a > b)
{
int temp = a;
a = b;
b = temp;
}
if (b > c)
{
int temp = b;
b = c;
c = temp;
}
if (a > b)
{
int temp = a;
a = b;
b = temp;
}
System.out.println(a);
System.out.println(b);
System.out.println(c);
System.out.println("");
System.out.println(x);
System.out.println(y);
System.out.println(z);
}
}