Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ScotlandPandaFlag
- {
- class ScotlandPandaFlag
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- char temp = (char)65;
- int j = 1;
- for (int i = 0; i < n; i++)
- {
- if (i == n/2)
- {
- Console.Write(new string('-', n / 2));
- if (temp == (char)91)
- {
- temp = (char)65;
- }
- Console.Write(new string((char)temp, 1));
- Console.Write(new string('-', n / 2));
- Console.WriteLine();
- if (temp == (char)91)
- {
- temp = (char)65;
- }
- else
- {
- temp++;
- }
- }
- else if (i < n / 2 && i > 0 )
- {
- Console.Write(new string('~', j));
- if (temp == (char)91)
- {
- temp = (char)65;
- }
- Console.Write(new string((char)temp, 1));
- Console.Write(new string('#', n - 2*j-2));
- if (temp == (char)91)
- {
- temp = (char)65;
- }
- else
- {
- temp++;
- }
- Console.Write(new string((char)temp, 1));
- Console.Write(new string('~', j));
- Console.WriteLine();
- if (temp == (char)91)
- {
- temp = (char)65;
- }
- else
- {
- temp++;
- }
- j++;
- }
- else if (i > n / 2 && i > 0)
- {
- j--;
- Console.Write(new string('~', j));
- if (temp == (char)91)
- {
- temp = (char)65;
- }
- Console.Write(new string((char)temp, 1));
- if (temp == (char)91)
- {
- temp = (char)65;
- }
- else
- {
- temp++;
- }
- Console.Write(new string('#', n - 2*j-2));
- if (temp == (char)91)
- {
- temp = (char)65;
- }
- Console.Write(new string((char)temp, 1));
- Console.Write(new string('~', j));
- Console.WriteLine();
- if (temp == (char)91)
- {
- temp = (char)65;
- }
- else
- {
- temp++;
- }
- }
- else if (i == 0)
- {
- if (temp == (char)91)
- {
- temp = (char)65;
- }
- Console.Write(new string((char)temp, 1));
- Console.Write(new string('#', n - 2));
- if (temp == (char)91)
- {
- temp = (char)65;
- }
- else
- {
- temp++;
- }
- Console.Write(new string((char)temp, 1));
- Console.WriteLine();
- if (temp == (char)91)
- {
- temp = (char)65;
- }
- else
- {
- temp++;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment