Cosmic ray detected!

呵呵。首先是:

[while (1) if (1 != 1) printf(”cosmic ray detected ”);

然后嘛,由于编译器会优化掉1!=1的条件,导致结果没有printf句,所以~

[

volatile int x = 0;
volatile int y = 0;
while (1) if (x != y) {
    printf(”Cosmic ray detected ”);
    y = x;
}

嘿嘿。关于这段程序,原文附带的评论是:

[What if the cosmic ray comes during the execution of printf?

Concurrency issues, man. You’ll need a cosmic ray detector inside your printf statement there, which puts you dangerously into yo dogg territory.

which puts you dangerously into yo dogg territory不知道怎么翻译

以及

 [The SETI source code has been leaked.]  SETI源码泄露了 

 哈哈!

然后,据原文作者说,他有个学生这样写:

[

if(x)

….
else if(!x)
….
else

printf(”Something is really messed up! ”);

]

原文在此: http://en.youxu.info/?p=75#comments

Small注: 了解SETI:http://www.seti.org

暂无评论

评论

暂无评论。

发表评论

*必填

*必填 (不会被公开)