打印自己的程序C#版
1class C
2{
3 static void Main()
4 {
5 System.Console.WriteLine(s,s,'\u0022');
6 }
7 const string s = @"class C
8{{
9 static void Main()
10 {{
11 System.Console.WriteLine(s,s,'\u0022');
12 }}
13 const string s = @{1}{0}{1};
14}}";
15}
2{
3 static void Main()
4 {
5 System.Console.WriteLine(s,s,'\u0022');
6 }
7 const string s = @"class C
8{{
9 static void Main()
10 {{
11 System.Console.WriteLine(s,s,'\u0022');
12 }}
13 const string s = @{1}{0}{1};
14}}";
15}
From: Adi Oltean's WebLog, 2004-07-07
1using System;
2public class Class1
3{
4 static void Main(string[] args)
5 {
6 Console.Write(code + '\u0022' + code + '\u0022' + ';' + '\n' + '}');
7 }
8 public static string code =
9@"using System;
10public class Class1
11{
12 static void Main(string[] args)
13 {
14 Console.Write(code + '\u0022' + code + '\u0022' + ';' + '\n' + '}');
15 }
16 public static string code =
17@";
18}
2public class Class1
3{
4 static void Main(string[] args)
5 {
6 Console.Write(code + '\u0022' + code + '\u0022' + ';' + '\n' + '}');
7 }
8 public static string code =
9@"using System;
10public class Class1
11{
12 static void Main(string[] args)
13 {
14 Console.Write(code + '\u0022' + code + '\u0022' + ';' + '\n' + '}');
15 }
16 public static string code =
17@";
18}