- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
typedef void proc();
proc nop{}
void swap(int *a, int *b) {*a^=*b^=*a^=*b;}
void sort_(int *arr, unsigned len)
{
(proc*[]){nop, swap}[*arr > arr[1]](arr, arr+1);
(proc*[]){nop, sort_}[len > 2](arr+1, len-1);
}
void sort(int *arr, unsigned len)
{
(proc*[]){sort_, nop}[len <= 1](arr, len);
(proc*[]){nop, sort}[len > 2](arr, len-1);
}