Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
用 Kotlin 语言写的最短的quine是什么?
在答案中查看我的实现,但我相信存在一个较短的实现。
这是 kotlin 脚本中的一个简单实现:
val a="val a=%c%s%c%nprint(a.format(34,a,34))" print(a.format(34,a,34))
经测试:
$ kotlinc -script quine.kts > out.kts $ diff -s quine.kts out.kts Files quine.kts and out.kts are identical
字符数:
$ stat quine.kts Size: 71