import java.util.*; public class array { public static void main(String[] args) { Scanner x = new Scanner(System.in); System.out.print("How many?"); int intputCount = x.nextInt(); int[] b = new int[a]; for(int c = 0; c < a; c++) { System.out.print("==>"); b[c] = x.nextInt(); } for(int c = 0; c < a; c++) { int s = c; for(int d = c + 1; d < a; d++) if(b[d] < b[s]) s = d; int t = b[c]; b[c] = b[s]; b[s] = t; } for(int c = 0; c < a; c++) System.out.print(b[c] + " "); System.out.println(); } }
I have an idea of what this code does, but how does it work?