Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace _3.Arrow
- {
- using System;
- public class Arrow
- {
- public static void Main(string[] args)
- {
- checked
- {
- int numN = int.Parse(Console.ReadLine());
- int lenghtIntDotSeq = numN - 2;
- string internalDotSeq = new string('.', lenghtIntDotSeq);
- int lenghtExtDotSeq;
- string externalDotSeq;
- for (int row = 1; row < numN; row++)
- {
- lenghtExtDotSeq = numN / 2;
- externalDotSeq = new string('.', lenghtExtDotSeq);
- if (row == 1)
- {
- string topSeq = new string('#', numN);
- Console.WriteLine("{0}{1}{0}", externalDotSeq, topSeq);
- }
- else
- {
- Console.WriteLine("{0}#{1}#{0}", externalDotSeq, internalDotSeq);
- }
- }
- string middleDsSeq = new string('#', (numN / 2) + 1);
- Console.WriteLine("{0}{1}{0}", middleDsSeq, internalDotSeq);
- int maxLenghtRow = (numN * 2) - 1;
- for (int row = 1; row < numN; row++)
- {
- if (row == numN - 1)
- {
- externalDotSeq = new string('.', (numN / 2) * 2);
- Console.WriteLine("{0}#{0}", externalDotSeq);
- }
- else
- {
- externalDotSeq = new string('.', row);
- lenghtIntDotSeq = maxLenghtRow - (2 * row) - 2;
- internalDotSeq = new string('.', lenghtIntDotSeq);
- Console.WriteLine("{0}#{1}#{0}", externalDotSeq, internalDotSeq);
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement