fbinnzhivko

03.02 Panda Scotland Flag

May 13th, 2016
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.78 KB | None | 0 0
  1. using System;
  2. class Program
  3. {
  4.     static void Main()
  5.     {
  6.         int n = int.Parse(Console.ReadLine());
  7.         char printChar = 'A';
  8.         int diez = n - 2;
  9.         int tilt = 0;
  10.  
  11.         for (int i = 0; i < n / 2; i++)
  12.         {
  13.             Console.Write(new string('~', tilt));
  14.             Console.Write(printChar);
  15.  
  16.             if (printChar == 'Z')
  17.             {
  18.                 printChar = 'A';
  19.             }
  20.             else
  21.             {
  22.                 printChar++;
  23.             }
  24.             Console.Write(new string('#', diez));
  25.             Console.Write(printChar);
  26.  
  27.             if (printChar == 'Z')
  28.             {
  29.                 printChar = 'A';
  30.             }
  31.             else
  32.             {
  33.                 printChar++;
  34.             }
  35.  
  36.             Console.Write(new string('~', tilt));
  37.             diez -= 2;
  38.             tilt++;
  39.             Console.WriteLine();
  40.         }
  41.  
  42.         Console.WriteLine("{0}{1}{0}", new string('-', (n - 1) / 2), printChar);
  43.  
  44.         diez = 1;
  45.         tilt = tilt - 1;
  46.         printChar++;
  47.  
  48.         for (int i = 0; i < n / 2; i++)
  49.         {
  50.             Console.Write(new string('~', tilt));
  51.             Console.Write(printChar);
  52.  
  53.             if (printChar == 'Z')
  54.             {
  55.                 printChar = 'A';
  56.             }
  57.             else
  58.             {
  59.                 printChar++;
  60.             }
  61.             Console.Write(new string('#', diez));
  62.             Console.Write(printChar);
  63.  
  64.             if (printChar == 'Z')
  65.             {
  66.                 printChar = 'A';
  67.             }
  68.             else
  69.             {
  70.                 printChar++;
  71.             }
  72.  
  73.             Console.Write(new string('~', tilt));
  74.  
  75.             diez += 2;
  76.             tilt--;
  77.             Console.WriteLine();
  78.         }
  79.     }
  80. }
Add Comment
Please, Sign In to add comment