/* Buborék rendezés */ #include int main() { int tomb[] = {3, 8, 2, 4, 5, 1, 6}; int n = 7; // A tömb elemeinek száma int i, j, tmp, utolsocsere; for(i= n-1; i>0 ; i = utolsocsere) { utolsocsere = 0; for(j=0; j tomb[j+1]) { tmp = tomb[j]; tomb[j] = tomb[j+1]; tomb[j+1] = tmp; utolsocsere = j; } } for(i=0; i