Haskell版的Quine

1.Haskell风格的

main = putStr (s ++ show s);s=" main = putStr (s ++ show s);s="

--我在想假如把s串放在最前面该怎么写。

2.C风格的,利用printf函数

import Text.Printf
s="import Text.Printf%cs=%c%s%c;main = printf s (13::Int) (34::Int) s (34::Int)";main = printf s (13::Int) (34::Int) s (34::Int)

分享到: 更多
友荐云推荐
原文地址:https://www.cnblogs.com/eternalwt/p/2554781.html