java解析marc乱码_国际C语言乱码大赛(IOCCC)的一个经典作品_小葡萄也有成熟时的博客-程序员秘密

技术标签: java解析marc乱码  

你也许听说过“国际C 语言乱码大赛(IOCCC)”,能获奖的人毫无疑问是世界顶级C程序员。这是他们利用C

语言的特点极限挖掘的结果。下面这个例子就是网上广为流传的一个经典作品:

#include

main(t,_,a)char *a;

{

return!0

main(-86,0,a+1)+a)):1,t<_>

main(2,_+1,"%s %d

%d\n"):9:16:t<0?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

:0

还没发狂?看来你抵抗力够强的。这是IOCCC 1988 年获奖作品,作者是Ian Phillipps。

毫无疑问,Ian Phillipps 是世界上最顶级的C 语言程序员之一。

你可以数数这里面用了多少个符号。当然这里我并不会讨论这段代码,也并不是鼓励你也去写这样的代码

(关于这段代码的分析,你可以上网查询)。

恰恰相反,我要告诉你的是:

大师把代码写成这样是经典,你把代码写成这样是垃圾!

所以在垃圾和经典之间,你需要做一个抉择。

---------附:高亮后的效果

a4c26d1e5885305701be709a3d33442f.png

---------附:在Microsoft Visual C++ 6.0中编译运行的结果为

Ot.dig.xry,d.Ca .ox.eiyr,dma,.m .dyug.lopg.hapg.do.mg

a.baydyrChg.rt.a.bgay.dyggv

Ot.dig.,gcotC.Ca .ox.eiyr,dma,.m .dyug.lopg.hapg.do.mg

dwo.duydlg.Copg,

atC.a.baydyrChg.rt.a.bgay.dyggv

Ot.dig.diryC.Ca .ox.eiyr,dma,.m .dyug.lopg.hapg.do.mg

diygg.xygtci.igt,f.dwo.duydlg.Copg,

atC.a.baydyrChg.rt.a.bgay.dyggv

Ot.dig.xouydi.Ca .ox.eiyr,dma,.m .dyug.lopg.hapg.do.mg

xouy.callrth.kryC,f.diygg.xygtci.igt,f.dwo.duydlg.Copg,

atC.a.baydyrChg.rt.a.bgay.dyggv

Ot.dig.xrxdi.Ca .ox.eiyr,dma,.m .dyug.lopg.hapg.do.mg

xrpg.holC.yrth,;

xouy.callrth.kryC,f.diygg.xygtci.igt,f.dwo.duydlg.Copg,

atC.a.baydyrChg.rt.a.bgay.dyggv

Ot.dig.,rndi.Ca .ox.eiyr,dma,.m .dyug.lopg.hapg.do.mg

,rn.hgg,g.a-la rthf.xrpg.holC.yrth,;

xouy.callrth.kryC,f.diygg.xygtci.igt,f.dwo.duydlg.Copg,

atC.a.baydyrChg.rt.a.bgay.dyggv

Ot.dig.,gpgtdi.Ca .ox.eiyr,dma,.m .dyug.lopg.hapg.do.mg

,gpgt.,wat,.a-,wrmmrthf

,rn.hgg,g.a-la rthf.xrpg.holC.yrth,;

xouy.callrth.kryC,f.diygg.xygtci.igt,f.dwo.duydlg.Copg,

atC.a.baydyrChg.rt.a.bgay.dyggv

Ot.dig.grhdi.Ca .ox.eiyr,dma,.m .dyug.lopg.hapg.do.mg

grhid.marC,.a-mrlsrthf.,gpgt.,wat,.a-,wrmmrthf

,rn.hgg,g.a-la rthf.xrpg.holC.yrth,;

xouy.callrth.kryC,f.diygg.xygtci.igt,f.dwo.duydlg.Copg,

atC.a.baydyrChg.rt.a.bgay.dyggv

Ot.dig.trtdi.Ca .ox.eiyr,dma,.m .dyug.lopg.hapg.do.mg

trtg.laCrg,.Catcrthf.grhid.marC,.a-mrlsrthf.,gpgt.,wat,.a-,wrmmrthf

,rn.hgg,g.a-la rthf.xrpg.holC.yrth,;

xouy.callrth.kryC,f.diygg.xygtci.igt,f.dwo.duydlg.Copg,

atC.a.baydyrChg.rt.a.bgay.dyggv

Ot.dig.dgtdi.Ca .ox.eiyr,dma,.m .dyug.lopg.hapg.do.mg

dgt.loyC,.a-lgabrthf

trtg.laCrg,.Catcrthf.grhid.marC,.a-mrlsrthf.,gpgt.,wat,.a-,wrmmrthf

,rn.hgg,g.a-la rthf.xrpg.holC.yrth,;

xouy.callrth.kryC,f.diygg.xygtci.igt,f.dwo.duydlg.Copg,

atC.a.baydyrChg.rt.a.bgay.dyggv

Ot.dig.glgpgtdi.Ca .ox.eiyr,dma,.m .dyug.lopg.hapg.do.mg

glgpgt.brbgy,.brbrthf.dgt.loyC,.a-lgabrthf

trtg.laCrg,.Catcrthf.grhid.marC,.a-mrlsrthf.,gpgt.,wat,.a-,wrmmrthf

,rn.hgg,g.a-la rthf.xrpg.holC.yrth,;

xouy.callrth.kryC,f.diygg.xygtci.igt,f.dwo.duydlg.Copg,

atC.a.baydyrChg.rt.a.bgay.dyggv

Ot.dig.dwglxdi.Ca .ox.eiyr,dma,.m .dyug.lopg.hapg.do.mg

dwglpg.Cyummgy,.Cyummrthf.glgpgt.brbgy,.brbrthf.dgt.loyC,.a-lgabrthf

trtg.laCrg,.Catcrthf.grhid.marC,.a-mrlsrthf.,gpgt.,wat,.a-,wrmmrthf

,rn.hgg,g.a-la rthf.xrpg.holC.yrth,;

xouy.callrth.kryC,f.diygg.xygtci.igt,f.dwo.duydlg.Copg,

atC.a.baydyrChg.rt.a.bgay.dyggv

-----------end--------------------------

运行结果如下:

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.

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_33216916/article/details/114806511

智能推荐

verlog简单的SPI收发接受器_robetwu的博客-程序员秘密

verlog简单的SPI收发接受器主程序代码如下/***********************************作者:robetwu时间:2020.7.15环境:Quartus 13.0发送和接受缓存器可以使用memory*******************/module sample_spi(clk,rst_n,wr,rd,si,sclk,so,cs,data_out,data_receive_buff);input clk;input rst_n;input wr;i

在学习Java中——Java的基础重要吗?_落失的风筝的博客-程序员秘密

很明确肯定重要且异常重要,用一个简单的比喻基础就是地基,有多深厚的地基就会有多高的建筑;相反地基建造的没有那么深厚,所建造出的建筑肯定受到地基的影响;当然也有很多人觉得学习Java基础部分掌握几个简单的知识点往后学就完啦!请注意这需要分两种情况:第一种代码搬运工、编程IT农民工这种偏业务型的工作,并不注重基础的工作,往往自己的知识上限已经被限制住啦,在IT领域常常做的工作比较浅层;第二种就是技术型工种注重基础知识的学习,培养夯实自己的基础,提高自己的学习上限。通常游走在底层,结实的底层知识就

nvm use xxx无效_nvm use 加不上星号_Cao_Mary的博客-程序员秘密

问题描述:使用nvm use xxx命令切换版本后,执行nvm ls命令,当前使用版本号前无“*”,未切换成功。问题原因:nodejs默认安装目录没有安装相对应的node版本。解决方案:1 删除nodejs文件夹,2 nvm uninstall xxx版本。3 重新nvm install xxx版本后,4 立马nvm use xxx对应版本,就能生效了。...

python--“chardet”安装方式_chardet安装_CS_Hoyun的博客-程序员秘密

库说明:    用于Python 2和3的通用编码检测器,使用chardet检测编码非常容易,chardet支持检测中文、日文、韩文等多种语言。 下载地址:    官网:https://pypi.org/project/chardet/     安装方式: 方式一   源码按照:        第一步:下载压缩文件,例如: 'chardet-3.0.4.tar.gz...

linux下对数据库操作_weixin_30362233的博客-程序员秘密

1. mysql -udev -pxxxxxxx // 备注:-u 用户名 -p 密码2. show databases; // 查看有哪些数据库3. use datebase; // 使用哪些数据库4. show tables; // 查看有哪些表5. exit; // 退出mysql6. desc table; // 查看表结构转载于:https://www.c...

随便推点

csdn任务系统说明_csdn我的考试 任务环境 半个小时_qq_41866553的博客-程序员秘密

因为没有积分所以试了一下任务系统,完全不知道有什么用处,关注公众号,程序人生的答案是我要下载码,生成个人海报的是保存海报,只给了几个下载码,完全不知道有什么用处,各位大神能不能指点一下在没有积分的情况下怎么才能获取积分呢?[email protected]欢迎使用Markdown编辑器你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Markdown编辑器, 可以仔细阅读这篇...

代码高亮,highlight.js的调用方法及其问题_weixin_33777877的博客-程序员秘密

highlight.js是一个用来高亮代码的插件下载地址:https://highlightjs.org/downl...配色参考:https://highlightjs.org/stati...使用方法:&lt;link rel="stylesheet" type="text/css" href="a11y-light.css"&gt...

微信小程序开发遇到的问题_小乖V小倩的博客-程序员秘密

1、使用wx.createSelectorQuery()获取不到节点信息 在小程序插件中使用wx.createSelectorQuery()获取不到节点信息,需要在后面加入in(this) 例如:const query = wx.createSelectorQuery().in(this) query.selectAll('#id-selector').boundingClientRect() query.exec(function (...

STM32F429 printf函数的实现_一代大侠胡小鱼的博客-程序员秘密

一、串口初始化GPIO初始化void uart_gpio_init(void){ GPIO_InitTypeDef GPIO_InitStruct; __HAL_RCC_USART1_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); /**USART1 GPIO Configuration PA9 ------&gt; USART1_TX PA10 ------&gt; USART1_RX *

cloudera impala安装完整版_快乐程序员的博客-程序员秘密

Impala安装完整版一、Impala简介Cloudera Impala对你存储在Apache Hadoop在HDFS,HBase的数据提供直接查询互动的SQL。除了像Hive使用相同的统一存储平台,Impala也使用相同的元数据,SQL语法(Hive SQL),ODBC驱动程序和用户界面(Hue Beeswax)。Impala还提供了一个熟悉的面向批量或实时查询和统一平台。二、安装要

关于qt中的tr()函数_qstring tr()_草尖上的舞动的博客-程序员秘密

在论坛中漂,经常遇到有人遇到tr相关的问题。用tr的有两类人:(1)因为发现中文老出问题,然后搜索,发现很多人用tr,于是他也开始用tr (2)另一类人,确实是出于国际化的需要,将需要在界面上显示的文件都用tr包起来,这有分两种: (2a) 用tr包住英文(最最推荐的用法,源码英文,然后提供英文到其他语言的翻译包) (2b) 用tr包住中文(源码用中文,然后提供中文到其他语言的翻译包) 注意哦,如果你正在用tr包裹中文字符,却不属于(2b),那么,这是个信号:你在误用tr 你需要的是Q

推荐文章

热门文章

相关标签