Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- static void Main()
- {
- int N = int.Parse(Console.ReadLine());
- int bottom = N * 2;
- int height = N + 1;
- int leftDots = 0;
- int rightDots = 0;
- string row = null;
- // print top row
- row = new string('.', N) + new string('*', N);
- Console.WriteLine(row);
- for (int i = 0; i < height - 2; i++)
- {
- leftDots = N - i - 1;
- rightDots = N - 1 + i;
- row = new string('.', leftDots);
- row += "*";
- row += new string('.', rightDots);
- row += "*";
- Console.WriteLine(row);
- }
- // print bottom row
- row = new string('*', bottom);
- Console.WriteLine(row);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement