Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace StripedTowel
- {
- class StripedTowel
- {
- static void Main()
- {
- int width = int.Parse(Console.ReadLine());
- int height = (int)Math.Floor(width * 1.5D);
- string row = "";
- List<string> hack = new List<string>();
- for(int i = 1; i <= 3; i++)
- {
- if(i % 2 == 0 )
- {
- string pattern = "..#";
- for(int a = 0; a < width; a++)
- {
- row += pattern;
- }
- }
- else if(i % 3 == 0)
- {
- string pattern = ".#.";
- for(int a = 0; a < width; a++)
- {
- row += pattern;
- }
- }
- else
- {
- string pattern = "#..";
- for(int a = 0; a < width; a++)
- {
- row += pattern;
- }
- }
- hack.Add(row.Remove(width));
- row = "";
- }
- int rows = 0;
- for(int i = 0; i < height; i++)
- {
- Console.WriteLine(hack[rows]);
- rows++;
- if(rows == 3 )
- {
- rows = 0;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement