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 n = int.Parse(Console.ReadLine());
- int dots = 1;
- int grids = n * 2 - 1;
- int spaces = 1;
- Console.WriteLine(new string ('#', (n * 4) + 1));
- for (int u = 1; u <= n; u++)
- {
- Console.WriteLine(new string('.', dots) + new string('#', grids) + new string(' ', spaces) + new string('#', grids) + new string('.', dots));
- dots++;
- grids -= 2;
- spaces += 2;
- if (grids < 1)
- {
- break;
- }
- if (u == n / 2)
- {
- Console.WriteLine(new string('.', dots) + new string('#', grids) + new string(' ', n / 2 - 1) + "(@)"+ new string(' ', n / 2 - 1) + new string('#', grids) + new string('.', dots));
- dots++;
- grids -= 2;
- if (grids < 1)
- {
- break;
- }
- spaces += 2;
- }
- }
- int dots2 = n + 1;
- int grids2 = n * 2 - 1;
- for (int d = 0; d < n; d++)
- {
- Console.WriteLine(new string('.', dots2) + new string('#', grids2) + new string('.', dots2));
- dots2++;
- grids2 -= 2;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement