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 nDot = 0;
- int nStar = 0;
- string row = null;
- int count = 1;
- for (int i = 0; i < N; i++)
- {
- if (i == 0 || i == N - 1)
- {
- row = new string('*', N);
- Console.WriteLine(row);
- continue;
- }
- if (i <= N / 2)
- {
- nDot = i;
- nStar = N / 2 - i;
- row = new string('.', nDot);
- row += new string('*', nStar);
- row += "*";
- row += new string('*', nStar);
- row += new string('.', nDot);
- Console.WriteLine(row);
- }
- else // print bottom part
- {
- nDot = N - i - 1;
- nStar = count;
- row = new string('.', nDot);
- row += new string('*', nStar);
- row += "*";
- row += new string('*', nStar);
- row += new string('.', nDot);
- Console.WriteLine(row);
- count++;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement