Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class SunGlasses
- {
- static void Main()
- {
- int N = 5;
- char[,] matrix = new char[N, N * 5];
- for (int row = 0; row < matrix.GetLength(0); row++)
- {
- for (int col = 0; col < matrix.GetLength(1); col++)
- {
- if (row == 0 || row == matrix.GetLength(0) - 1)
- {
- if (col < N * 2 || col >= N * 3)
- {
- matrix[row, col] = '*';
- }
- }
- else
- {
- if(col == 0 || col == N * 2 - 1
- || col == N * 3 || col == N * 5 - 1)
- {
- matrix[row, col] = '*';
- }
- else if (col < N * 2 || col > N * 3)//за стъклата
- {
- matrix[row, col] = '/';
- }
- else if (row == N / 2 && col >= N * 2 && col < N * 3)
- {
- matrix[row, col] = '|';
- }
- else
- {
- matrix[row, col] = ' ';
- }
- }
- }
- }
- 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