Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class FirThree
- {
- static void Main()
- {
- byte n, line, current, last;
- int lenght, left, right;
- n = byte.Parse(Console.ReadLine());
- if ((n >= 4) && (n <= 100))
- {
- lenght = (2 * n) + 1;
- for (line = 1; line <= n; line++)
- {
- left = (n + 1) - line;
- right = (n - 1) + line;
- for (current = 0; current < lenght; current++)
- {
- if ((current >= left) && (current <= right))
- {
- Console.Write("*");
- }
- else
- {
- Console.Write(".");
- }
- }
- Console.WriteLine();
- }
- for (last = 0; last < lenght; last++)
- {
- if (last == n)
- {
- Console.Write("*");
- }
- else
- {
- Console.Write(".");
- }
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement