With the help of a loop, print the numbers in the following way.

one
6
2 2
7 7
3 3 3
8 8 8
4 4 4 4
9 9 9 9

Closed due to the fact that the participants were off-topic Igor , AK , Cheg , Lex Hobbit , jfs 16 Sep '17 at 6:59 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The message contains only the text of the task, in which there is no description of the problem, or the question is purely formal (" how do I do this task ") . To reopen the question, add a description of the specific problem, explain what does not work, what you see the problem. " - Igor, AK, Cheg, Lex Hobbit
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • one
    It would be nice to see your attempts - Andrey NOP
  • @ Andrew, yes, I have prescribed cycles, and then I could not :) - dadyaSasha

1 answer 1

For example:

for (int x = 1; x <= 4; ++x) { for (int i = 0; i < x; ++i) { Console.Write(x + " "); } Console.WriteLine(); for (int i = 0; i < x; ++i) { Console.Write(x + 5 + " "); } Console.WriteLine(); } 

Or so:

 for (int x = 1; x <= 4; ++x) { Console.WriteLine(string.Join(" ", new int[x].Select(v => x))); Console.WriteLine(string.Join(" ", new int[x].Select(v => x + 5))); }