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 _02.Crocs
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- for (int i = 0; i < n / 2; i++)
- {
- TopAndBottom(n);
- }
- SecondPart(n);
- for (int i = 0; i < n - 1; i++)
- {
- MiddlePart(n);
- }
- Console.WriteLine(nPlusOneLine(n));
- SecondPart(n);
- for (int i = 0; i < n - (n / 2); i++)
- {
- Console.WriteLine(nFiveTimes(n));
- Console.WriteLine(nPlusOneLine(n));
- }
- Console.WriteLine(nFiveTimes(n));
- for (int i = 0; i < n / 2; i++)
- {
- TopAndBottom(n);
- }
- }
- static void TopAndBottom(int n)
- {
- var topAndBottomSb = new StringBuilder();
- topAndBottomSb.Append(new string(' ', n));
- topAndBottomSb.Append(new string('#', n * 3));
- topAndBottomSb.Append(new string(' ', n));
- Console.WriteLine(topAndBottomSb.ToString());
- }
- static void SecondPart(int n)
- {
- var secondPartSb = new StringBuilder();
- secondPartSb.Append(new string('#', n));
- secondPartSb.Append(new string(' ', n * 3));
- secondPartSb.Append(new string('#', n));
- Console.WriteLine(secondPartSb.ToString());
- }
- static void MiddlePart(int n)
- {
- var secondMiddlePartSb = new StringBuilder();
- Console.WriteLine(nPlusOneLine(n));
- secondMiddlePartSb.Append(new string('#', n));
- secondMiddlePartSb.Append(" ");
- secondMiddlePartSb.Append(string.Concat(Enumerable.Repeat(" #", n + (n / 2) - 1)));
- secondMiddlePartSb.Append(" ");
- secondMiddlePartSb.Append(new string('#', n));
- Console.WriteLine(secondMiddlePartSb.ToString());
- }
- static string nPlusOneLine(int n)
- {
- var middlePartSb = new StringBuilder();
- middlePartSb.Append(new string('#', n));
- middlePartSb.Append(string.Concat(Enumerable.Repeat(" #", n + (n / 2))));
- middlePartSb.Append(' ');
- middlePartSb.Append(new string('#', n));
- return middlePartSb.ToString(); ;
- }
- static string nFiveTimes(int n)
- {
- return new string('#', n * 5);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement