Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- class Program
- {
- public static List<char> reversedList = new List<char>();
- static void Main()
- {
- double width = double.Parse(Console.ReadLine());
- FirstLine(width);
- SecondLine(width);
- ThirdLine(width);
- }
- public static void FirstLine(double width)
- {
- int counter = 0;
- for (int i = 0; i < 1; i++)
- {
- for (int j = 1; j <= (width + 3) / 2; j++)
- {
- if (j % 2 != 0)
- {
- Console.Write("#");
- counter++;
- }
- else if (j % 2 == 0 && j == (width + 3) / 2 && counter % 2 == 0)
- {
- Console.Write(".");
- }
- else
- {
- Console.Write("..");
- }
- }
- }
- Console.WriteLine();
- }
- public static void SecondLine(double width)
- {
- int secondCounter = 0;
- int counter = 0;
- for (int i = 0; i < 1; i++)
- {
- for (int j = 1; j <= (width + 3) / 2; j++)
- {
- if (j % 2 != 0 && j != (width + 3) / 2)
- {
- reversedList.Add('.');
- reversedList.Add('.');
- Console.Write("..");
- secondCounter++;
- }
- else if (j % 2 != 0 && j == (width + 3) / 2 && counter % 2 == 0)
- {
- reversedList.Add('.');
- Console.Write(".");
- }
- else if (j % 2 != 0 && j == (width + 3) / 2 && counter % 2 != 0)
- {
- Console.Write(".");
- }
- else if (secondCounter % 2 == 0 && j == (width + 3) / 2)
- {
- break;
- }
- else
- {
- reversedList.Add('#');
- Console.Write("#");
- counter++;
- }
- }
- }
- Console.WriteLine();
- }
- private static void ThirdLine(double width)
- {
- int secondCounter = 0;
- for (int i = 0; i < 1; i++)
- {
- for (int j = 1; j <= (width + 3) / 2; j++)
- {
- if (j == 1)
- {
- Console.Write(".");
- }
- else
- {
- if (j % 2 != 0 && j!= (width + 3) / 2)
- {
- Console.Write("..");
- secondCounter++;
- }
- else if (j % 2 != 0 && j == (width + 3) / 2 && secondCounter % 2 == 0)
- {
- Console.Write(".");
- }
- else
- {
- Console.Write("#");
- }
- }
- }
- }
- Console.WriteLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement