Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class DrawFigure
- {
- static void Main(string[] args)
- {
- string line = Console.ReadLine();
- int n = int.Parse(line);
- for (int i = 0; i <= n / 2; i++)
- {
- string dots = new string('.', i);
- string stars = new string('*', n - 2 * i);
- Console.WriteLine("{0}{1}{2}", dots, stars, dots);
- }
- for (int i = n / 2 - 1; i >= 0; i--)
- {
- string dots = new string('.', i);
- string stars = new string('*', n - 2 * i);
- Console.WriteLine("{0}{1}{2}", dots, stars, dots);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement