let focus = 'computing' in here
God's in his heaven, All's right with the world.
September 16, 2006
发生在我身边的一个算法笑话
当年老师教我们算法入门,讲到一道题目,说输入一个整数 N,要求输出所以不大于这个整数的除3可以整除的正整数。
大家都是这么写的(伪代码):
for X from 1 to N step 1
if X%3=0
print X
end if
end for
我们班体委突然发彪,给出了一个惊世骇俗的解答:
for X from 3 to N step 3
print X
end for
老师晕死,全班人疯了~~
1 comment:
Anonymous said...
呵呵,老师也没想到啊
2:17 PM, February 12, 2008
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
1 comment:
呵呵,老师也没想到啊
Post a Comment