programming puzzles
所在版块:求学狮城 发贴时间:2007-04-24 17:12  评分:

用户信息
复制本帖HTML代码
高亮: 今天贴 X 昨天贴 X 前天贴 X 
Write a "Hello World" program in 'C' without using a semicolon.
(this is tricky)

C/C++ : Exchange two numbers without using a temporary variable.
(somehow classic way)

C/C++ : Find if the given number is a power of 2.
(somehow classic way)

Write a program whose printed output is an exact copy of the source. Needless to say, merely echoing the actual source file is not allowed.
(a bit hard to think)

source: http://developers.slashdot.org/article.pl?sid=04/12/04/0116231
.
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!

Put your OWN COOL signature here!
 相关帖子 我要回复↙ ↗回到正文
programming puzzles 吴永铮   (476 bytes , 736reads )
my answer to (4) 吴永铮   (284 bytes , 253reads )
(Y) hash   (0 bytes , 225reads )
what do you mean by classic way? icky   (96 bytes , 265reads )
(3) can be done by less than 5 instructions 吴永铮   (66 bytes , 256reads )
check equality with all 2's power icky   (31 bytes , 292reads )
can be simpler and faster 吴永铮   (0 bytes , 226reads )
先模1<<16和除 1<<16 icky   (130 bytes , 247reads )
(num > 0) && (((num - 1) & num) == 0) ? 这就是生活   (0 bytes , 266reads )
correct 吴永铮   (177 bytes , 233reads )
opps ^ is wrong. It's always true. 吴永铮   (0 bytes , 243reads )
i was thinking of checking bit also. hash   (18 bytes , 256reads )
interesting... let me try 1&2... hash   (106 bytes , 379reads )
oh, i was thinking using while icky   (55 bytes , 302reads )
世界真奇妙 soc胖浪人   (0 bytes , 201reads )