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 FirTree
- {
- class FirTree
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int width = n * 2 - 3;
- Console.Write(new string('.', width / 2));
- Console.Write('*');
- Console.Write(new string('.', width / 2));
- Console.WriteLine();
- for (int i = 1; i < n / 2; i++)
- {
- Console.Write(new string('.', width / 2 - i));
- Console.Write(new string('*', i + i + 1));
- Console.Write(new string('.', width / 2 - i));
- Console.WriteLine();
- }
- for (int i = n / 2; i < n-1; i++)
- {
- Console.Write(new string('.', width / 2 - i));
- Console.Write(new string('*', i + i + 1));
- Console.Write(new string('.', width / 2 - i));
- Console.WriteLine();
- }
- Console.Write(new string('.', width / 2 ));
- Console.Write('*');
- Console.Write(new string('.', width / 2 ));
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement