Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.4 kB
3
Indexable
using System;

class Quine
{
    static void Main()
    {
        string[] source = {
            "using System;",
            "",
            "class Quine",
            "{",
            "    static void Main()",
            "    {",
            "        string[] source = {",
            "        };",
            "",
            "        for (int i = 0; i < 7; i++)",
            "        {",
            "            Console.WriteLine(source[i]);",
            "        }",
            "",
            "        for (int i = 0; i < source.Length; i++)",
            "        {",
            "            Console.WriteLine(\"            \\\"{0}\\\",\", source[i].Replace(\"\\\"\", \"\\\\\\\"\"));",
            "        }",
            "",
            "        for (int i = 7; i < source.Length; i++)",
            "        {",
            "            Console.WriteLine(source[i]);",
            "        }",
            "    }",
            "}",
        };

        for (int i = 0; i < 7; i++)
        {
            Console.WriteLine(source[i]);
        }

        for (int i = 0; i < source.Length; i++)
        {
            Console.WriteLine("            \"{0}\",", source[i].Replace("\"", "\\\""));
        }

        for (int i = 7; i < source.Length; i++)
        {
            Console.WriteLine(source[i]);
        }
    }
}