esiste anche il motore di ricerca: Bubble Sort
...completo:
codice:#include <stdio.h> #include <stdlib.h> int main() { int vet[10] = {2, 1, 0, 6, 9, 5, 8, 7, 3, 4}; int i, j, temp; for(i = 0; i < 10; i++) printf("%d ", vet[i]); for(i = 0; i < 9; i++) for(j = i + 1; j < 10; j++) if(vet[j] < vet[i]) { temp = vet[i]; vet[i] = vet[j]; vet[j] = temp; } printf("\n"); for(i = 0; i < 10; i++) printf("%d ", vet[i]); printf("\n"); system("pause"); return 0; }