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 Triangle
- {
- class Program
- {
- static void Main(string[] args)
- {
- int size = int.Parse(Console.ReadLine());
- int point = 1;
- int sharp = (4 * size - 2) / 2;
- int empty = 1;
- Console.WriteLine(new string ('#', (4 * size + 1)));
- for (int row = 1; row <= size; row++)
- {
- if (row == (size / 2 + 1))
- {
- Console.Write(new string('.', point));
- Console.Write(new string('#', sharp));
- Console.Write(new string(' ', empty / 2 - 1));
- Console.Write("(@)");
- Console.Write(new string(' ', empty / 2 - 1));
- Console.Write(new string('#', sharp));
- Console.Write(new string('.', point));
- sharp -=2;
- point++;
- empty+= 2;
- Console.WriteLine();
- }
- else
- {
- for (int col = 1; col <= point; col++)
- {
- Console.Write(".");
- }
- for (int col = 1; col <= sharp; col++)
- {
- Console.Write("#");
- }
- for (int i = 1; i <= empty; i++)
- {
- Console.Write(" ");
- }
- for (int col = 1; col <= sharp; col++)
- {
- Console.Write("#");
- }
- for (int col = 1; col <= point; col++)
- {
- Console.Write(".");
- }
- point++;
- sharp -= 2;
- empty += 2;
- Console.WriteLine();
- }
- }
- sharp = (4 * size - 2) / 2;
- for (int row = 1; row <= size; row++)
- {
- for (int col = 1; col <= point; col++)
- {
- Console.Write(".");
- }
- for (int col = 1; col <= sharp; col++)
- {
- Console.Write("#");
- }
- for (int col = 1; col <= point; col++)
- {
- Console.Write(".");
- }
- point++;
- sharp-= 2;
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement