Advertisement
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 _03_beer
- {
- class Beer
- {
- static void DrawLineElements(int l, int m, int width, string a)
- {
- for(int i=0; i<width; i++)
- {
- if(i==l || i==m)
- {
- Console.Write("*");
- }
- else
- {
- Console.Write(a);
- }
- }
- Console.WriteLine();
- }
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int width = n * 2;
- int widthTop = n + 1;
- int height = n * 3 + 1;
- int leftRight = (width - widthTop) / 2;
- //firstLine
- for (int i=0; i<width-leftRight; i++)
- {
- if(i<leftRight || i>(width-1-leftRight))
- {
- Console.Write(" ");
- }
- else
- {
- Console.Write("*");
- }
- }
- Console.WriteLine();
- //top bottle
- for (int j = 0; j <= leftRight; j++ )
- {
- for (int i = 0; i < width; i++)
- {
- if (i == leftRight || i == (width -1- leftRight))
- {
- Console.Write("*");
- }
- else
- {
- Console.Write(" ");
- }
- }
- Console.WriteLine();
- }
- for (int j = leftRight-1; j > 0; j--)
- {
- DrawLineElements(j, width - 1-j, width, " ");
- }
- for (int i = 0; i < n; i++ )
- {
- DrawLineElements(0, width-1, width, ".");
- }
- for (int i = 0; i < n; i++)
- {
- DrawLineElements(0, width - 1, width, "@");
- }
- DrawLineElements(0, 1, width, "*");
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement