Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class FirTree
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- if ((n > 3) && (n < 101))
- {
- for (int treeRow = 0; treeRow < n - 1; treeRow++)
- {
- int pointCount = n - 2 - treeRow;
- int asteriskCount = 2 * treeRow + 1;
- for (int point = 0; point < pointCount; point++)
- {
- Console.Write(".");
- }
- for (int point = 0; point < asteriskCount; point++)
- {
- Console.Write("*");
- }
- for (int point = 0; point < pointCount; point++)
- {
- Console.Write(".");
- }
- Console.WriteLine("");
- }
- for (int stemRow = 0; stemRow < 1; stemRow++)
- {
- for (int point = 1; point <= (n - 2 - stemRow); point++)
- {
- Console.Write(".");
- }
- for (int asterisk = 0; asterisk < 1; asterisk++)
- {
- Console.Write("*");
- }
- for (int point = 1; point <= (n - 2 - stemRow); point++)
- {
- Console.Write(".");
- }
- Console.WriteLine("");
- }
- }
- else
- {
- Console.WriteLine("Wrong Value!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement