2009年1月7日星期三

14行 SelfPrinting

using System;
public class WriteMyself{static void Main(){string[] stat1=new string[8];string[] stat2=new string[8];char c=(char)34;string s=c.ToString();
stat1[0] = "using System;";
stat1[1] = "public class WriteMyself{static void Main(){string[] stat1=new string[8];string[] stat2=new string[8];char c=(char)34;string s=c.ToString();";
stat1[2] = "for (int i = 0; i < 2; i++) { Console.WriteLine(stat1[i]); }";
stat1[3] = "for (int i = 0; i < 7; i++) { stat2[i] = c + stat1[i] + c; }";
stat1[4] = "for (int i = 0; i < 7; i++) { ";
stat1[5] = "Console.WriteLine(stat1[{0}] = {1};, i, i==5?stat2[i].Insert(19, s).Insert(37, s): stat2[i]); ";
stat1[6] = "}for (int i = 2; i < 7; i++) {Console.WriteLine(i!=5?stat1[i]:stat1[i].Insert(18,s).Insert(36,s));}}}";
for (int i = 0; i < 2; i++) { Console.WriteLine(stat1[i]); }
for (int i = 0; i < 7; i++) { stat2[i] = c + stat1[i] + c;}
for (int i = 0; i < 7; i++) {
Console.WriteLine("stat1[{0}] = {1};", i, i==5?stat2[i].Insert(19, s).Insert(37, s): stat2[i]);
}for (int i = 2; i < 7; i++) {Console.WriteLine(i!=5?stat1[i]:stat1[i].Insert(18,s).Insert(36,s));}}}