public class InsertSort {
public static void main(String [] args){
int [] a = {1,52,3,21,541,122,321};
for(int i = 1; i < a.length; i++){
for(int j = 0; j < i ; j++){
if ( a[i] < a[j]){
a[i] = a[i] + a[j];
a[j] = a[i] - a[j];
a[i] = a[i] - a[j];
break;
}
}
}
for(int c: a){
System.out.println(c);
}
}
}