发福利了!!!

C20210009 2022-09-26 20:37:14

import java.util.Scanner;

class Main { public static void main(String[] args) { Scanner cin=new Scanner(System.in); final byte n=3; int a[]=new int[n]; for(int i=0;i<n;i++) a[i]=cin.nextInt(); for(int i=0;i<n;i++) { for(int j=i+1;j<n;j++) { if(a[i]>a[j]) { int temp=a[i]; a[i]=a[j]; a[j]=temp; } } } for(int i=0;i<n;i++) System.out.print(a[i]+" "); } }