public class SortApp{
public static void main(String[] args) {
int swap;
int tab[] = {4,3,2,5,6,78,43,23,78};
for (int i = 0; i < tab.length-1; i++){
for(int j = 0; j < tab.length-1; j++){
if(tab[j] > tab[j+1]){
swap = tab[j];
tab[j] = tab[j+1];
tab[j+1] = swap;
System.out.print(tab[j]+", ");
}
}
}
}
}
Próbowałem przerobić ten kod na wszystkie strony ale tak jakby pętla się za mało razy wykonuje czy co?
Dlaczego nie działa?