Created
December 10, 2015 21:17
-
-
Save anonymous/131dbaab752c19d1f861 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
class LineInventer | |
{ | |
static void Main() | |
{ | |
int matrixSize = int.Parse(Console.ReadLine()); | |
int rows = matrixSize; | |
int cols = matrixSize; | |
int forCounter = 0; | |
char[,] matrix = new char[rows, cols]; | |
string input; | |
input = Console.ReadLine(); | |
for (int i = 0; i < matrix.GetLength(0); i++) | |
{ | |
for (int j = 0; j < matrix.GetLength(1); j++) | |
{ | |
matrix[i, j] = input[j]; | |
forCounter++; | |
} | |
if (forCounter == matrixSize * matrixSize) | |
{ | |
break; | |
} | |
else input = Console.ReadLine(); | |
} | |
foreach (var counter in matrix) | |
{ | |
Console.WriteLine(counter); | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment