一下这段代码可以在多种语言的编译器下编译通过,并在不同的编译器下显示出各部相同的字符串.
有这几个语言:C, C++, Perl, TeX, LaTeX, PostScript, sh, bash, zsh and Prolog

我没有验证,也没办法验证哈.我没有那么多的编译器,如果谁有兴趣又无聊可以验证下哈.

     %:/*:if 0;"true" +s ||true<</;#|+q|*/include<stdio.h>/*\_/
     {\if(%)}newpath/Times-Roman findfont 20 scalefont setfont(
     %%)pop 72 72 moveto(Just another PostScript hacker,)show((
     t)}. t:-write('Just another Prolog hacker,'),nl,halt. :-t.
     :-initialization(t). end_of_file. %)pop pop showpage(-: */
     int main(){return 0&printf("Just another C%s hacker,\n",1%
     sizeof'2'*2+"++");}/*\fi}\csname @gobble\endcsname{\egroup
     \let\LaTeX\TeX\ifx}\if00\documentclass{article}\begin{doc%
     ument}\fi Just another \LaTeX\ hacker,\end{document}|if 0;
     /(J.*)\$sh(.*)"/,print"$1Perl$2$/"if$_.=q # hack the lang!
     /
     sh=sh;test $BASH_VERSION &&sh=bash;test $POSIXLY_CORRECT&&
     sh=sh;test   $ZSH_VERSION && sh=zsh;awk 'BEGIN{x="%c[A%c[K"
     printf(x,27,27)}';echo "Just another $sh hacker," #)pop%*/


blog comments powered by Disqus

Published

2007-02-27

Categories


Tags