听说洛谷上有一道输出程序本身的题?

灌水区

洛谷上没有 loj有 这种程序一般称为 quine 更加广义的 quine 有解压后包含自身的 zip
by WYXkk @ 2022-01-15 18:50:49


哦,谢谢了。
by O3O_O3O_O3O @ 2022-01-15 18:52:56


@[O3O_O3O_O3O](/user/513807) <https://loj.ac/p/4> 这个
by hanyuchen2019 @ 2022-01-15 18:54:17


~~自己出一个不就好了?~~
by 欢黎明陌 @ 2022-01-15 19:01:17


@[欢黎明陌](/user/402211) 这事情洛谷目前办不到(目前judge是不能查看选手源代码的)
by yummy @ 2022-01-15 19:11:51


`print(open(__file__).read(),end='')`即可
by stOtue @ 2022-01-15 19:14:23


我记得以前有人发过[这个](https://www.luogu.com.cn/problem/U166923),问怎么写 SPJ,不过他最后也没写出来,理论上洛谷也不可能有这种题。
by rzh123 @ 2022-01-15 19:23:41


> `print(open(__file__).read(),end='')`即可 答非所问
by FerventTempo @ 2022-01-15 19:24:19


import sys with open(sys.argv[0], 'r', encoding='utf-8') as f: print(f.read())
by Catcats @ 2022-01-16 11:07:21


|