C# 版,为简化字符串操作,该程序只有一行。
class P{static void Main(){string s="class P{{static void Main(){{string s={1}{0}{1};System.Console.WriteLine(s,s,(char)34);}}}}";System.Console.WriteLine(s,s,(char)34);}}
Python版
print (lambda s: s.replace(chr(042),chr(047))%s)('print (lambda s: s.replace(chr(042), chr(047))%%s)("%s")')
Language: C++
#include<iostream.h>
main(){char*s="#include<iostream.h>%cmain(){char*s=%c%s%c;cout.form(s,10,34,s,34,10);}%c";cout.form(s,10,34,s,34,10);}
Language: C
main(a){printf(a="main(a){printf(a=%c%s%c,34,a,34);}",34,a,34);}
Language: Perl
$b='$b=%c%s%c;printf$b,39,$b,39;';printf$b,39,$b,39;
Language: Pascal
CONST T=';BEGIN WRITE(#67#79#78#83#84#32#84#61#39,T,#39,T)END.';BEGIN WRITE(#67#79#78#83#84#32#84#61#39,T,#39,T)END.
Language: Java
class S{public static void main(String[]a){String s="class S{public static void main(String[]a){String s=;char c=34;System.out.println(s.substring(0,52)+c+s+c+s.substring(52));}}";char c=34;System.out.println(s.substring(0,52)+c+s+c+s.substring(52));}}