Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Снежинка
- {
- class Program
- {
- static void Main(string[] args)
- {
- var n = int.Parse(Console.ReadLine());
- int hight = 2 * n + 1;
- int widht = 2 * n + 3;
- int dotTopCount = n;
- string dotTop = new string('.', dotTopCount);
- Console.WriteLine($"*{dotTop}*{dotTop}*");
- // UP
- for (int row = 1; row < n - 1; row++)
- {
- for (int col = n - row; col < n ; col++)
- {
- Console.Write(".");
- }
- Console.Write("*");
- for (int colTwo = 1+row; colTwo <= n; colTwo++)
- {
- Console.Write(".");
- }
- Console.Write("*");
- for (int colTwo = 1 + row; colTwo <= n; colTwo++)
- {
- Console.Write(".");
- }
- Console.Write("*");
- for (int col = n - row; col < n; col++)
- {
- Console.Write(".");
- }
- Console.WriteLine();
- }
- // MIDLE
- int starsMidTwoCount = 5;
- string starsMidTwo = new string('*', starsMidTwoCount);
- int dotsMidTwoCount = (widht - starsMidTwoCount) / 2;
- string dotsMidTwo = new string('.', dotsMidTwoCount);
- Console.WriteLine($"{dotsMidTwo}{starsMidTwo}{dotsMidTwo}");
- int starsMidCount = widht ;
- string starsMid = new string('*', starsMidCount);
- Console.WriteLine($"{starsMid}");
- Console.WriteLine($"{dotsMidTwo}{starsMidTwo}{dotsMidTwo}");
- // MIDLE
- for (int row = n - 1; row > 1; row--)
- {
- for (int col = n - row + 1; col < n; col++)
- {
- Console.Write(".");
- }
- Console.Write("*");
- for (int colTwo = 1 + row - 1; colTwo <= n; colTwo++)
- {
- Console.Write(".");
- }
- Console.Write("*");
- for (int colTwo = 1 + row - 1; colTwo <= n; colTwo++)
- {
- Console.Write(".");
- }
- Console.Write("*");
- for (int col = n - row + 1; col < n; col++)
- {
- Console.Write(".");
- }
- Console.WriteLine();
- }
- // DOWN
- Console.WriteLine($"*{dotTop}*{dotTop}*");
- }
- }
- }
- // 3 *...*...*
- // .*..*..*.
- // ..*****..
- // *********
- // ..*****..
- // .*..*..*.
- // *...*...*
- // 5 *.....*.....*
- // .*....*....*.
- // ..*...*...*..
- // ...*..*..*...
- // ....*****....
- // *************
- // ....*****....
- // ...*..*..*...
- // ..*...*...*..
- // .*....*....*.
- // *.....*.....*
Advertisement
Add Comment
Please, Sign In to add comment