Prime Substrings by whatisgolf

char*b,*o,d[99],v[99];n,p,f;main(l){for(;o=v,gets(d);puts(v))for(l=0;d[l++];*o=0)for(b=d;b[l-1];*o++=p|48)for(b[l]*=2,n=atoi(b),b++[l]/=2,f=p=n>1;++f<n;)p=p&&n%f;}

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

download

return to the top page