Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class BatCoikosTower
- {
- static void Main()
- {
- int N = int.Parse(Console.ReadLine());
- char[,] matrix = new char[N, N * 2];
- int middleDots = 1, counter = 2;
- bool isMiddle = false;
- for (int row = 0; row < matrix.GetLength(0); row++)
- {
- for (int col = 0; col < matrix.GetLength(1); col++)
- {
- if (col < (N - row - 1))
- {
- matrix[row, col] = '.';
- }
- else if(col == N - row - 1)
- {
- matrix[row, col] = '/';
- }
- else if (col == N + row)
- {
- matrix[row, col] = '\\';
- }
- else if (col > N + row)
- {
- matrix[row, col] = '.';
- }
- else
- {
- if (middleDots == row)
- {
- matrix[row, col] = '-';
- isMiddle = true;
- }
- else
- {
- matrix[row,col] = '.';
- }
- }
- }
- if (isMiddle)
- {
- middleDots += counter;
- counter++;
- isMiddle = false;
- }
- }
- for (int row = 0; row < matrix.GetLength(0); row++)
- {
- for (int col = 0; col < matrix.GetLength(1); col++)
- {
- Console.Write(matrix[row,col]);
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment