Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Rocket
- {
- class Program
- {
- static void Main(string[] args)
- {
- int size = int.Parse(Console.ReadLine());
- char dot = '.';
- char forwardSlash = '/';
- char backSlash = '\\';
- char emptySpace = ' ';
- char asterisk = '*';
- char pipe = '|';
- int backgroundSymbolsCount = ((size * 3) - 2) / 2;
- int middleSymbolsCount = 0;
- //printing the top part
- for (int currPart = 0; currPart < size; currPart++)
- {
- string background = new string(dot, backgroundSymbolsCount);
- string middlePart = new string(emptySpace, middleSymbolsCount);
- Console.WriteLine(background + forwardSlash + middlePart + backSlash + background);
- backgroundSymbolsCount--;
- middleSymbolsCount += 2;
- }
- //printing the middle part
- backgroundSymbolsCount++;
- middleSymbolsCount -= 2;
- for (int currPart = 0; currPart < size * 2 + 1; currPart++)
- {
- char borderSymbol = currPart == 0 ? asterisk : pipe;
- char middlySymbol = currPart == 0 ? asterisk : backSlash;
- string background = new string(dot, backgroundSymbolsCount);
- string middlePart = new string(middlySymbol, middleSymbolsCount);
- Console.WriteLine(background + borderSymbol + middlePart + borderSymbol + background);
- }
- for (int currPart = 0; currPart < size / 2; currPart++)
- {
- string background = new string(dot, backgroundSymbolsCount);
- string middlePart = new string(asterisk, middleSymbolsCount);
- Console.WriteLine(background + forwardSlash + middlePart + backSlash + background);
- backgroundSymbolsCount--;
- middleSymbolsCount += 2;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment