一般这种题目都不能使用文件相关的函数的吧,不然就简单很多了,啥模块都不用:
print file(__file__).read()
--
Best Regards,
Leo Jay
我喜欢年经贴
>>> 1
1
cat test.c
# ==========================
#include <stdio.h>
#include <stdlib.h>
extern char * _binary_test_c_start;
int main()
{
printf("%s", (char *)&_binary_test_c_start);
}
# =========================
black4 77: cat Makefile
# =========================
SRC = test.c
TAR = t
ALL:test.c
objcopy -I binary -O elf32-i386 -B i386 test.c test.bin
gcc -o t test.c test.bin
# ==========================
Heroboy 写道:
看不明白楼上的C是怎样print self的
q a b c=putStrLn $ b ++ [toEnum 10,'q','('] ++ show b ++ [','] ++ show c ++ [','] ++ show a ++ [')']
main=q "q a b c=putStrLn $ b ++ [toEnum 10,'q','('] ++ show b ++ [','] ++ show c ++ [','] ++ show a ++ [')']" "def q(a,b,c):print b+chr(10)+'q('+repr(b)+','+repr(c)+','+repr(a)+')'" "def e(x) return 34.chr+x+34.chr end;def q(a,b,c) print b+10.chr+'main=q '+e(b)+' '+e(c)+' '+e(a)+' '+10.chr end
这是一个 Haskell 程序,运行它会输出一个 Python 程序,再运行这个 Python 程序会输出一个 Ruby 程序,再运行这个 Ruby 程序会得到一个 Haskell 程序,对了!就和最开始那个 Haskell 程序一模一样的!
2009/8/28 袁雁波 <yanbo...@gmail.com>:
--
Any complex technology which doesn’t come with documentation must be the best
available.
Sent from Sydney, Nsw, Australia
所以也可以说,这是一个python程序,它->ruby->haskell,再变回python XD
2009/8/28 袁雁波 <yanbo...@gmail.com>: