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 Draw_Figure
- {
- class Draw_Figure
- {
- static void Main(string[] args)
- {
- int N = int.Parse(Console.ReadLine());
- Console.WriteLine(new string('*', N));
- int M = 1;
- for (int i = 1; i <= M; i++)
- {
- if (M <= N - i)
- {
- Console.WriteLine("{0}{1}{0}", new string('.', i), new string('*', N - M - i));
- M++;
- }
- }
- for (int j = M; j >= 1; j--)
- {
- if (M < N - j)
- {
- M--;
- Console.WriteLine("{0}{1}{0}", new string('.', j), new string('*', N - M - j + 1));
- }
- }
- Console.WriteLine(new string('*', N));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement