---
# System prepended metadata

title: 11166 - Simple integer sorting
tags: [sort]

---

# 11166 - Simple integer sorting
>author: Utin
###### tags: `sort`
---

## Brief
See the code below

## Solution 0

```c=
#include <stdio.h>
#include <stdlib.h>

int arr[10001];

int cmp(const void* a, const void* b);

int main() {
    int T;
    scanf("%d", &T);
    while (T--) {
        int len;
        scanf("%d", &len);
        for (int i = 0; i < len; i++) {
            scanf("%d", &arr[i]);
        }
        qsort(arr, len, sizeof(int), cmp);
        for (int i = 0; i < len; i++) {
            printf("%d", arr[i]);
            if (i != len-1) printf(" ");
            else printf("\n");
        }
    }
}

int cmp(const void* a, const void* b) {
    int A = *(int*) a;
    int B = *(int*) b;
    return A > B ? 1 : 0;
}

// By Utin
```

## Reference