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 _05.Triangle
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- //Printing The First Line
- Console.WriteLine(new string('#', (4*n) + 1));
- //Making some help variables for count of symbols
- var dotsCount = 1;
- var spacesCount = 1;
- //Printing Next N Lines
- for (int i = 0; i < n; i++)
- {
- var diesCount = (((4 * n) + 1) - (2 * dotsCount + spacesCount)) / 2;
- //Checking for the middle line
- if (i == n / 2)
- {
- //TODO some logic here for middle line
- Console.WriteLine(new string('.', dotsCount) +
- new string('#', diesCount) + new string(' ', (spacesCount - 3) / 2) +
- "(@)" + new string(' ', (spacesCount - 3) / 2) +
- new string('#', diesCount) + new string('.', dotsCount));
- }
- else
- {
- //Printing Lines where there is not eye
- Console.WriteLine(new string('.', dotsCount) +
- new string('#', diesCount) + new string(' ', spacesCount) +
- new string('#', diesCount) + new string('.', dotsCount));
- }
- dotsCount++;
- spacesCount += 2;
- }
- //Printing the final lines here
- //They are N count
- //Changing the variables for the first line
- spacesCount -= 2;
- var bottomDiesCount = spacesCount;
- for (int i = 0; i < n; i++)
- {
- Console.WriteLine(new string('.', dotsCount) +
- new string('#', bottomDiesCount) + new string('.', dotsCount));
- dotsCount++;
- bottomDiesCount -= 2;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement