Sharkovskii order by not

n[99];i;k;c;d;f(int*a,int*b){c=*a&-*a;d=*b&-*b;return *a&*a-1?*b&*b-1?c<d?-1:c>d?:*a>*b?:-1:-1:*b&*b-1?1:c<d?:-1;}main(){for(;~scanf("%d",n+k++););for(qsort(n,k-1,4,f);i<k-1;)printf("%d\n",n[i++]);}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page