Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Carpets
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine()) / 2;
- string slash1 = "";
- string slash2 = "";
- string dots = new string('.', n);
- for (int i = 1; i <= n; i++)
- {
- if (i % 2 == 1)
- {
- slash1 = slash1 + "/";
- slash2 = "\\" + slash2;
- }
- else
- {
- slash1 = slash1 + " ";
- slash2 = " " + slash2;
- }
- dots = dots.Substring(1);
- Console.WriteLine(dots + slash1 + slash2 + dots);
- }
- if (n % 2 == 0)
- {
- slash1 = slash1.Substring(1) + slash1[0];
- slash2 = slash2.Substring(1) + slash2[0];
- }
- for (int i = n-1; i >= 0; i--)
- {
- Console.WriteLine(dots + slash2 + slash1 + dots);
- dots = dots + ".";
- slash2 = slash2.Remove(i);
- slash1 = slash1.Substring(1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement