免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 8370 | 回复: 10
打印 上一主题 下一主题

真他妈的牛B,天外有天,人外有人呀! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-03-03 14:12 |只看该作者 |倒序浏览
怪异C程序获奖作品:

  1. main() { printf(&unix["\021%six\012\0"], (unix)["have"] + "fun" - 0x60); }
复制代码


晦涩C程序获奖作品:

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

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
2 [报告]
发表于 2003-03-03 14:38 |只看该作者

真他妈的牛B,天外有天,人外有人呀!

有挑战力!分析ing......

论坛徽章:
0
3 [报告]
发表于 2003-03-03 14:48 |只看该作者

真他妈的牛B,天外有天,人外有人呀!

怪异~~~~~
把代码粘贴下来,保存成123.c 和 456.c在vc 6环境里调试,报错……

--------------------Configuration: 123 - Win32 Debug--------------------
Compiling...
123.cpp
D:\c++\temp\123.cpp(2) : error C2065: 'unix' : undeclared identifier
D:\c++\temp\123.cpp(2) : warning C4508: 'main' : function should return a value; 'void' return type assumed
Error executing cl.exe.

123.exe - 1 error(s), 1 warning(s)


--------------------Configuration: 456 - Win32 Debug--------------------
Compiling...
456.c
d:\c++\temp\456.c(15) : warning C4129: ' ' : unrecognized character escape sequence
d:\c++\temp\456.c(15) : error C2001: newline in constant
d:\c++\temp\456.c(16) : error C2143: syntax error : missing ')' before ';'
d:\c++\temp\456.c(16) : error C2014: preprocessor command must start as first nonwhite space
d:\c++\temp\456.c(17) : error C2014: preprocessor command must start as first nonwhite space
d:\c++\temp\456.c(1 : error C2059: syntax error : ')'
d:\c++\temp\456.c(1 : error C2065: 'q' : undeclared identifier
d:\c++\temp\456.c(1 : error C2143: syntax error : missing ';' before '{'
d:\c++\temp\456.c(1 : error C2065: 'nl' : undeclared identifier
d:\c++\temp\456.c(1 : error C2143: syntax error : missing ';' before ']'
d:\c++\temp\456.c(1 : error C2014: preprocessor command must start as first nonwhite space
d:\c++\temp\456.c(19) : error C2015: too many characters in constant
d:\c++\temp\456.c(19) : error C2143: syntax error : missing ';' before ':'
d:\c++\temp\456.c(19) : error C2015: too many characters in constant
d:\c++\temp\456.c(19) : error C2015: too many characters in constant
d:\c++\temp\456.c(19) : error C2065: 'r' : undeclared identifier
d:\c++\temp\456.c(19) : error C2143: syntax error : missing ';' before 'constant'
d:\c++\temp\456.c(19) : error C2146: syntax error : missing ';' before identifier 'c'
d:\c++\temp\456.c(19) : error C2017: illegal escape sequence
d:\c++\temp\456.c(20) : error C2065: 'c' : undeclared identifier
d:\c++\temp\456.c(20) : error C2015: too many characters in constant
d:\c++\temp\456.c(20) : error C2143: syntax error : missing ';' before 'constant'
d:\c++\temp\456.c(20) : error C2059: syntax error : ','
d:\c++\temp\456.c(20) : error C2014: preprocessor command must start as first nonwhite space
d:\c++\temp\456.c(21) : error C2001: newline in constant
d:\c++\temp\456.c(21) : error C2015: too many characters in constant
d:\c++\temp\456.c(26) : fatal error C1004: unexpected end of file found
Error executing cl.exe.

456.exe - 26 error(s), 1 warning(s)

论坛徽章:
0
4 [报告]
发表于 2003-03-03 14:57 |只看该作者

真他妈的牛B,天外有天,人外有人呀!

我gcc编译都通过了,其他的编译器我到没试。

输出结果分别为:
unix

和:
On the first day of Christmas my true love gave to me
a partridge in a pear tree.

On the second day of Christmas my true love gave to me
two turtle doves
and a partridge in a pear tree.

On the third day of Christmas my true love gave to me
three french hens, two turtle doves
and a partridge in a pear tree.

On the fourth day of Christmas my true love gave to me
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the fifth day of Christmas my true love gave to me
five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the sixth day of Christmas my true love gave to me
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the seventh day of Christmas my true love gave to me
seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the eigth day of Christmas my true love gave to me
eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the ninth day of Christmas my true love gave to me
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the tenth day of Christmas my true love gave to me
ten lords a-leaping,
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the eleventh day of Christmas my true love gave to me
eleven pipers piping, ten lords a-leaping,
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the twelfth day of Christmas my true love gave to me
twelve drummers drumming, eleven pipers piping, ten lords a-leaping,
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

论坛徽章:
0
5 [报告]
发表于 2003-03-04 09:53 |只看该作者

真他妈的牛B,天外有天,人外有人呀!

在linuxforum上有过讨论

因为在unix下
unix宏被定义成1
但是在其它平台下没有定义
所以会有问题

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
6 [报告]
发表于 2003-03-04 10:19 |只看该作者

真他妈的牛B,天外有天,人外有人呀!

这老头说话很粗鲁哦

论坛徽章:
0
7 [报告]
发表于 2003-03-04 11:50 |只看该作者

真他妈的牛B,天外有天,人外有人呀!

[quote]原帖由 "biansj"][/quote 发表:

第一次见到这样怪的代码,还是第一次见到在代码中出现中括号,不知道它的用法是怎么样的?哪位大侠给解释一下,谢谢:)

论坛徽章:
0
8 [报告]
发表于 2003-03-04 12:33 |只看该作者

真他妈的牛B,天外有天,人外有人呀!

第一道题目解答:

主要考虑两个知识点:
1.unix是一个宏,值为1
2.a[1]==*(a+1)==*(1+a)==1[a]

其他的自己用printf试一试就知道了.

第二道真是晦涩我也没有分析完,期待ing...

论坛徽章:
0
9 [报告]
发表于 2003-03-04 12:36 |只看该作者

真他妈的牛B,天外有天,人外有人呀!

[quote]原帖由 "laoxia"]这老头说话很粗鲁哦[/quote 发表:


谁规定老头就不能说粗话啦,不过对于像你这样的祖国花朵是有一些玷污.    

下次注意!   

论坛徽章:
0
10 [报告]
发表于 2003-03-04 21:04 |只看该作者

真他妈的牛B,天外有天,人外有人呀!

  1. 主要考虑两个知识点:
  2. 1.unix是一个宏,值为1
  3. 2.a[1]==*(a+1)==*(1+a)==1[a]
复制代码

不理解最后这个1[a]...
是个什么意思?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP