there is such a line:

string stroka="aaaa"; 

if I continue to write:

 stroka="aaab"; stroka="aaab"; 

I know about the cycle, but it isn’t good about the willow, the question is not in the cash register either: how to achieve the result of this so that the computer gives out all these lines I wrote with the code like this:

 string stroka = "aaaa"; stroka = "aaab"; stroka = "aaac"; stroka = "aaad"; Console.WriteLine(stroka); Console.ReadKey(); 

The piece of iron naturally gave me only aaad, but I need to get all the lines, without giving them any other meaning, maybe through a block or otherwise, so as not to write like this:

 static void Main(string[] args) { string stroka = "aaaa"; string stroka1 = "aaab"; string stroka2 = "aaac"; string stroka3 = "aaad"; Console.WriteLine(stroka); Console.WriteLine(stroka1); Console.WriteLine(stroka2); Console.WriteLine(stroka3); Console.ReadKey(); } 

but this is no good for me!

    1 answer 1

    The question is terrible, but I will try.

     string stroka = "aaaa"; Console.WriteLine(stroka); stroka = "aaab"; Console.WriteLine(stroka); stroka = "aaac"; Console.WriteLine(stroka); stroka = "aaad"; Console.WriteLine(stroka); 

    Upd. “And if in one command WriteLine (...)”:

     Console.WriteLine("aaaa" + "\r\n" + "aaab" + "\r\n" + "aaac" + "\r\n" + "aaad"); 
    • and if in one command WriteLine (...); "The question is terrible" - I explained everything quite normally - komra23
    • @ komra23, Added upd to the answer. By the way, if you explain the original problem, the answer may be much more meaningful. - s8am
    • task: I need to get all the lines, without giving them any other value, maybe through a block or otherwise, not to write like this: static void Main(string[] args) { string stroka = "aaaa"; string stroka1 = "aaab"; string stroka2 = "aaac"; string stroka3 = "aaad"; Console.WriteLine(stroka); Console.WriteLine(stroka1); Console.WriteLine(stroka2); Console.WriteLine(stroka3); Console.ReadKey(); } static void Main(string[] args) { string stroka = "aaaa"; string stroka1 = "aaab"; string stroka2 = "aaac"; string stroka3 = "aaad"; Console.WriteLine(stroka); Console.WriteLine(stroka1); Console.WriteLine(stroka2); Console.WriteLine(stroka3); Console.ReadKey(); } static void Main(string[] args) { string stroka = "aaaa"; string stroka1 = "aaab"; string stroka2 = "aaac"; string stroka3 = "aaad"; Console.WriteLine(stroka); Console.WriteLine(stroka1); Console.WriteLine(stroka2); Console.WriteLine(stroka3); Console.ReadKey(); } - komra23