partition by parity by csanders

int i,c,a[99];f(int*x,int*y){return*x<*y;}main(b){for(;scanf("%d",&a[c++])>0;);qsort(a,--c,4,f);for(;b--+1;puts(""))for(i=c;i--;((a[i]^b)&1)||printf("%d\n",a[i]));}

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

download

return to the top page