Post History
C, 534 bytes Strictly conforming program. #include <stdio.h> #include <stdlib.h> #include <string.h> char i=1,**c,**d,*t[30]={"red","yellow","green","brown","scarlet","blac...
Answer
#1: Initial revision
# C, 534 bytes Strictly conforming program. <!-- language-all: lang-c --> #include <stdio.h> #include <stdlib.h> #include <string.h> char i=1,**c,**d,*t[30]={"red","yellow","green","brown","scarlet","black","ochre","peach","ruby","olive","violet","fawn","lilac","gold","chocolate","mauve","cream","crimson","silver","rose","azure","lemon","russet","grey","purple","white","pink","orange","blue"};int f(const void*a,const void*b){c=d=t;for(;*c;)if(!strcmp(*c++,*(char**)a))break;for(;*d;)if(!strcmp(*d++,*(char**)b))break;return c<d?-1:c!=d;}int main(int c,char**v){qsort(v+1,c-1,8,f);for(;i<c;)puts(v[i++]);} The `char*` casts are a bit questionable in a strictly conforming program since they remove const qualifiers. My argument for why it is valid, is that the effective type of the argv strings ought to be `char[]`. I couldn't figure out how to use massive amounts of command line arguments on tio.run, here's a Godbolt with the worst test case entered: https://godbolt.org/z/vbdYe6cxx