正在閱讀:誰敢來挑戰(zhàn):天書奇談C & C#版誰敢來挑戰(zhàn):天書奇談C & C#版

2005-09-23 09:57 出處: 作者:cs.bgu.ac.il 責任編輯:moningfeng

  熱點推薦世界編程大賽頭名程序    拯救Delphi:開源社區(qū)的機會

  這是一個國外網(wǎng)站之前搞的有獎比賽, 以寫出看不懂的程序為最高...原文是C語言版(注意,是C程序,不是C++程序,可以用任何C編譯器編譯這段程序,但未必能通過C++編譯)。最近由國內的一位愛好者將其改為C#版,誓要將程序閱讀比賽挑戰(zhàn)到底。

  原文說明:Here's a nice challange for people who THINK they know how to read other people's code...

  It's a small C program. I know, I know, it doesn't look like it's gonna get compiled, but believe me, it does. Try to guess this program's output, then try to run it. You'll be amazed to see what it does!

  C語言版的挑戰(zhàn)

#include <stdio.h>
main(t,_,a)char *a;{return!0<t?t<3?main(-79,-13,a+main(-87,1-_,
main(-86,0,a+1)+a)):1,t<_?main(t+1,_,a):3,main(-94,-27+t,a)&&t==2?_<13?
main(2,_+1,"%s %d %d\n"):9:16:t<0?t<-72?main(_,t,
"@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l+,/n{n+,/+#n+,/#\
;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l \
q#'+d'K#!/+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;# \
){nl]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#n'wk nw' \
iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c \
;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;#'rdq#w! nr'/ ') }+}{rl#'{n' ')# \
}'+}##(!!/")
:t<-50?_==*a?putchar(31[a]):main(-65,_,a+1):main((*a=='/')+t,_,a+1)
:0<t?main(2,2,"%s"):*a=='/'||main(0,main(-61,*a,
"!ek;dc i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"),a+1);}



  C#版的挑戰(zhàn)

1 class __{static void Main(){O(1,0,"");}static int O(int l,int I,string _){int o;
2 if(1<l){if(3>l)O(-79,-13,_.Substring(O(-87,1-I,_.Substring(O(-86,0,_.Substring(1
3 ))))));if(I>l)O(l+1,I,_);o=0==O(-94,-27+l,_)||l!=2?16:I>12?9:O(2,I+1,"air|skyiv"
4 );}else if(0>l){if(-72>l)o=O(I,l,"@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+"+
5 ",/w#q#n+,/#{l+,/n{n+,/+#n+,/#;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l"+
6 " q#'+d'K#!/+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;# )"+
7 "{nl]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#n'wk nw' iwk{KK{nl]!/"+
8 "w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c ;;{nl'-{}rw]'/+,}##'*}#nc,',#nw"+
9 "]'/+kd'+e}+;#'rdq#w! nr'/ ') }+}{rl#'{n' ')# }'+}##(!!/");else if(-51<l)o=O((_[
10 0]==47?1:0)+l,I,_.Substring(1));else if(I!=_[0])o=O(-65,I,_.Substring(1));else{o
11 =_[31];System.Console.Write(_[31]);}}else o=0<l?O(2,2,"c#"):47==_[0]?1:O(0,O(-61
12 ,_[0],"!ek;dc i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"),_.
13 Substring(1));return o;}}

302 Found

302 Found


Powered by Tengine
tengine