Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using System.Numerics;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Threading.Tasks;
- namespace solutions
- {
- class Program
- {
- public static void Main()
- {
- var matrixSize = Console.ReadLine().Split().Select(int.Parse).ToArray();
- var snake = Console.ReadLine();
- var rows = matrixSize[0];
- var cols = matrixSize[1];
- var matrix = new char[rows, cols];
- var counter = 0;
- for (int row = 0; row < rows; row++)
- {
- for (int col = 0; col < cols; col++)
- {
- if (counter == snake.Length)
- {
- counter = 0;
- }
- matrix[row, col] = snake[counter];
- counter++;
- }
- }
- for (int row = 0; row < rows; row++)
- {
- for (int col = 0; col < cols; col++)
- {
- Console.Write(matrix[row, col]);
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement