Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class PandaScotlandFlag
- {
- public static void Main()
- {
- checked
- {
- int length = int.Parse(Console.ReadLine());
- char letter = 'A';
- if (length > 1)
- {
- int innerWidth = length - 2;
- string innerTopSequence = new string('#', innerWidth);
- int counter = 1;
- Console.WriteLine("{0}{1}{2}", letter, innerTopSequence, (char)(letter + counter));
- string outerSequence;
- string innerSequence;
- char firstLetter;
- char secondLetter;
- for (int row = 1; row < (length / 2); row++)
- {
- innerWidth -= 2;
- counter++;
- outerSequence = new string('~', row);
- innerSequence = new string('#', innerWidth);
- firstLetter = (char)(letter + (counter % 26));
- counter++;
- secondLetter = (char)(letter + (counter % 26));
- Console.WriteLine("{0}{1}{2}{3}{0}", outerSequence, firstLetter, innerSequence, secondLetter);
- }
- string outerHyphenSeq = new string('-', length / 2);
- counter++;
- char middleLetter = (char)(letter + (counter % 26));
- Console.WriteLine("{0}{1}{0}", outerHyphenSeq, middleLetter);
- int outerWidth = (length / 2) - 1;
- innerWidth = 1;
- for (int row = 0; row < (length / 2); row++)
- {
- outerSequence = new string('~', outerWidth);
- innerSequence = new string('#', innerWidth);
- counter++;
- firstLetter = (char)(letter + (counter % 26));
- counter++;
- secondLetter = (char)(letter + (counter % 26));
- Console.WriteLine("{0}{1}{2}{3}{0}", outerSequence, firstLetter, innerSequence, secondLetter);
- outerWidth--;
- innerWidth += 2;
- }
- }
- else
- {
- Console.WriteLine(letter);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement