这个程序做什么用的? [英] What does this program do?

查看:94
本文介绍了这个程序做什么用的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(别担心,这不是家庭作业或其他任何东西......只是一个脑筋急转弯,如果

你是如此倾向)


#include< stdlib.h>


int main(无效)

{

unsigned long i, j,k;


for(i = j = k = 1; - j || k; k = j?i%j?k:kj:(j = i + = 2));

返回EXIT_SUCCESS;

}


-

Christopher Benson-Manica |我*应该*知道我在说什么 - 如果我

ataru(at)cyberspace.org |不,我需要知道。火焰欢迎。

(don''t worry, it isn''t homework or anything... just a brain-teaser if
you''re so inclined)

#include <stdlib.h>

int main(void)
{
unsigned long i,j,k;

for(i=j=k=1;--j||k;k=j?i%j?k:k-j:(j=i+=2));
return EXIT_SUCCESS;
}

--
Christopher Benson-Manica | I *should* know what I''m talking about - if I
ataru(at)cyberspace.org | don''t, I need to know. Flames welcome.

推荐答案

" Christopher Benson-Manica" <在*** @ nospam.cyberspace.org>在消息中写道

news:br ********** @ chessie.cirr.com ...
"Christopher Benson-Manica" <at***@nospam.cyberspace.org> wrote in message
news:br**********@chessie.cirr.com...
(别担心,它不是不做作业或其他任何东西......如果你是如此倾向于脑筋急转弯吗?

#include< stdlib.h>

int main(void)
{
unsigned long i,j,k;

for(i = j = k = 1; - j || k; k = j ?i%j?k:kj:(j = i + = 2));
返回EXIT_SUCCESS;
}
(don''t worry, it isn''t homework or anything... just a brain-teaser if
you''re so inclined)

#include <stdlib.h>

int main(void)
{
unsigned long i,j,k;

for(i=j=k=1;--j||k;k=j?i%j?k:k-j:(j=i+=2));
return EXIT_SUCCESS;
}




浪费人们'是时候看了。



It wastes people''s time reading it.




Jarmo < JA *** @ jarmo.com>在消息中写道

news:3f ********************** @ reading.news.pipex.n et ...

"Jarmo" <ja***@jarmo.com> wrote in message
news:3f**********************@reading.news.pipex.n et...
" Christopher Benson-Manica" <在*** @ nospam.cyberspace.org>在消息中写道
新闻:br ********** @ chessie.cirr.com ...
"Christopher Benson-Manica" <at***@nospam.cyberspace.org> wrote in message
news:br**********@chessie.cirr.com...
(别担心,这不是作业或其他任何东西......只是一个脑筋急转弯,如果你这么倾向的话)

#include< stdlib.h>

int main(无效) )
{
无符号长i,j,k;

for(i = j = k = 1; - j || k; k = j?i%j ?k:kj:(j = i + = 2));
返回EXIT_SUCCESS;
}
(don''t worry, it isn''t homework or anything... just a brain-teaser if
you''re so inclined)

#include <stdlib.h>

int main(void)
{
unsigned long i,j,k;

for(i=j=k=1;--j||k;k=j?i%j?k:k-j:(j=i+=2));
return EXIT_SUCCESS;
}



这浪费了人们阅读它的时间。



It wastes people''s time reading it.



hehheh是的。令人遗憾的是,人类的思想如此顽皮并且并不专注于

一些非常重要的......就像这样......
http://freshmeat.net/projects/libcaca/

;-)


尊重,

Toni Uusitalo


hehheh yep. It''s shame that human mind is so playful and doesn''t focus on
some really important like... well like this
http://freshmeat.net/projects/libcaca/
;-)

with respect,
Toni Uusitalo


文章< br ********* *@chessie.cirr.com>,

Christopher Benson-Manica< at *** @ nospam.cyberspace.org>写道:
In article <br**********@chessie.cirr.com>,
Christopher Benson-Manica <at***@nospam.cyberspace.org> wrote:
(别担心,这不是作业或其他任何东西......只是一个脑筋急转弯,如果你这么倾向的话)

#include< stdlib.h>

int main(void)
{
unsigned long i,j,k;

(i = j = k = 1; - j || k; k = j?i%j?k:kj:(j = i + = 2));
返回EXIT_SUCCESS;
}
(don''t worry, it isn''t homework or anything... just a brain-teaser if
you''re so inclined)

#include <stdlib.h>

int main(void)
{
unsigned long i,j,k;

for(i=j=k=1;--j||k;k=j?i%j?k:k-j:(j=i+=2));
return EXIT_SUCCESS;
}




因为你没有输出任何东西,所以选项是无限循环。或者

旋转轮并最终返回,具有不同的时间量

旋转轮。部分可以采取。 旋转并最终返回

选项可以通过足够积极的优化器转换为立即返回

,尽管一般情况可能需要解决

暂停问题。


我认为这是一个无限循环。


(我会给其他人一个机会看到它并同意或不同意

与我,如果我记得的话,稍后发布我的分析。)

dave


-

Dave Vandervies dj ***** *@csclub.uwaterloo.ca

但这只是因为,在我的意思之下,冷酷无情的外表,那里有'b $ ba意味着,冷酷无情的内部等待被释放。

- 理查德希思菲尔德



Since you''re not outputting anything, the options are "infinite loop" or
"spin wheels and eventually return", with varying amounts of time that the
"spin wheels" part could take. The "spin wheels and eventually return"
option can be converted by a sufficiently aggressive optimizer to "return
immediately", though the general case for that may require solving the
halting problem.

It looks to me like it''s an infinite loop.

(I''ll give some other people a chance to see it and agree or disagree
with me and, if I remember, post my analysis later.)
dave

--
Dave Vandervies dj******@csclub.uwaterloo.ca
But that''s only because, underneath my mean, callous exterior, there''s
a mean, callous interior waiting to be unleashed.
--Richard Heathfield


这篇关于这个程序做什么用的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆