Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
257 B
11
Indexable
Never
void sort(int n, int *a) {
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            if (a[i] > a[j]) { //swap
                int t = a[i];
                a[i] = a[j];
                a[j] = t;
            }
        }
    }
}