Advertisement
NelIfandieva

StarSprangledBanner_Draw

Jan 22nd, 2020
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.99 KB | None | 0 0
  1. int input = int.Parse(Console.ReadLine());// 6
  2.             int width = ((input * 2) + (input * 6 - 2)) + 1; // (input * 2) + (input * input) - 2
  3.  
  4.             for (int i = 1; i <= input + 3; i++)
  5.             {
  6.                 if (i % 2 != 0)
  7.                 {
  8.                     for (int j = 1; j <= input; j++)
  9.                     {
  10.                         Console.Write("{0} ", '*');
  11.                     }
  12.                     Console.Write("{0}{1}", ' ', new string('=', input * 6 - 2));
  13.                 }
  14.                 else
  15.                 {
  16.                     for (int j = 1; j <= input - 1; j++)
  17.                     {
  18.                         Console.Write(" *");
  19.                     }
  20.                     Console.Write("{0}{0}{0}{1}", " ", new string('=', input * 6 - 2));
  21.                 }
  22.                 Console.WriteLine();
  23.             }
  24.  
  25.             for (int i = 1; i <= input; i++)
  26.             {
  27.                 Console.WriteLine("{0}", new string('=', width));
  28.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement