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