Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _5Question
- {
- class Program
- {
- static void Main(string[] args)
- {
- int number = int.Parse(Console.ReadLine());
- int width = 5 * number;
- int height = (2 * number) + 3;
- int firstrowstars = number;
- int firstrowdashes = (width - number) / 2;
- string firstrowofstars = new string('*', firstrowstars);
- string firstrowofdashes = new string('-', firstrowdashes);
- Console.WriteLine("{0}{1}{0}", firstrowofdashes, firstrowofstars); // REMINDER: first row & last row
- var dashessecondrow = (width - firstrowstars - 4) / 2;
- var andsymbol = number + 2;
- var starssecondrow = 1; //(number / 2 ) / 2 - doesn't work with bigger numbers.
- for (int row2 = 0; row2 < number / 2; row2++) // REMINDER: reverse it for bottom part
- {
- string dashesforsecondrow = new string('-', dashessecondrow);
- string andsymbols = new string('&', andsymbol);
- string starsforsecondrow = new string('*', starssecondrow);
- Console.WriteLine("{0}{1}{2}{1}{0}", dashesforsecondrow, starsforsecondrow, andsymbols);
- dashessecondrow -= 2;
- andsymbol += 2;
- starssecondrow++;
- }
- dashessecondrow += 1;
- var waves = width - (dashessecondrow * 2) - 4;
- for (int row3 = 0; row3 < number / 2; row3++)
- {
- string dashesforsecondrow = new string('-', dashessecondrow);
- string wavesforsecondrow = new string('~', waves);
- Console.WriteLine("{0}**{1}**{0}", dashesforsecondrow, wavesforsecondrow);
- dashessecondrow--;
- waves += 2;
- }
- dashessecondrow++;
- var column = width - (dashessecondrow * 2) - 2;
- string dashesmidrow = new string('-', dashessecondrow);
- string columnrow = new string('|', column);
- Console.WriteLine("{0}*{1}*{0}", dashesmidrow, columnrow);
- waves -= 2;
- for (int row3 = 0; row3 < number / 2; row3++)
- {
- string dashesforsecondrow = new string('-', dashessecondrow);
- string wavesforsecondrow = new string('~', waves);
- Console.WriteLine("{0}**{1}**{0}", dashesforsecondrow, wavesforsecondrow);
- waves -= 2;
- dashessecondrow++;
- }
- andsymbol -= 2;
- starssecondrow--;
- for (int row2 = 0; row2 < number / 2; row2++) // REMINDER: reverse it for bottom part
- {
- string dashesforsecondrow = new string('-', dashessecondrow);
- string andsymbols = new string('&', andsymbol);
- string starsforsecondrow = new string('*', starssecondrow);
- Console.WriteLine("{0}{1}{2}{1}{0}", dashesforsecondrow, starsforsecondrow, andsymbols);
- dashessecondrow += 2;
- andsymbol -= 2;
- starssecondrow--;
- }
- Console.WriteLine("{0}{1}{0}", firstrowofdashes, firstrowofstars);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement