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