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 ConsoleApplication3
- {
- class Program
- {
- static void Main(string[] args)
- {
- int width = int.Parse(Console.ReadLine());
- int height = (int)(width * 1.5);
- char one = '#';
- char two = '.';
- for (int i = 0; i < height; i++)
- {
- for (int j = 0; j < width; j++)
- {
- if ( i % 3 == 0 && j % 3 == 0)
- {
- Console.Write(one);
- }
- if (i % 3 == 0 && j % 3 != 0)
- {
- Console.Write(two);
- }
- if (i % 3 != 0 && (j + 1) % 3 == 0 && ( i + 1 ) % 3 != 0)
- {
- Console.Write(one);
- }
- if (i % 3 != 0 && (j + 1) % 3 != 0 && (i + 1) % 3 != 0)
- {
- Console.Write(two);
- }
- if ((i + 1) % 3 == 0 && ( j + 2) % 3 == 0)
- {
- Console.Write(one);
- }
- if ((i + 1) % 3 == 0 && (j + 2) % 3 != 0)
- {
- Console.Write(two);
- }
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement