#include <stdio.h>

#define ARR_LEN 10

void bsort(int *v, int n) {
    int t = 0;
    for (int i = 0; i < n - 1; i++) {
        for (int j = n - 1; j > i; j--) {
            if (*(v + j - 1) > *(v + j)) {
                t = *(v + j);
                *(v + j) = *(v + j - 1);
                *(v + j - 1) = t;
            }
        }
    }
}

int main(void) {
    int a[ARR_LEN] = {0};

    printf("Input %d integer entries:\n", ARR_LEN);
    for (int i = 0; i < ARR_LEN; i++) {
        printf("#%d: ", i+1);
        scanf("%d", &(a[i]));
    }

    bsort(a, ARR_LEN);

    printf("\nResult:\n");

    for (int i = 0; i < ARR_LEN; i++) {
        printf("a[%d] = %d\n", i, a[i]);
    }

    return 0;
}
