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());
- Console.WriteLine(
- "{0}",
- new string('*', size));
- int nexDots = 1;
- int topDots = size - 2;
- for (int i = 1; i < size / 2; i++)
- {
- Console.WriteLine(
- "{0}{1}{0}",
- new string('.', nexDots),
- new string('*', topDots));
- nexDots++;
- topDots -= 2;
- }
- Console.WriteLine(
- "{0}{1}{0}",
- new string('.', size / 2),
- new string('*', 1));
- nexDots--;
- topDots += 2;
- for (int i = 0; i < size / 2; i++)
- {
- Console.WriteLine(
- "{0}{1}{0}",
- new string('.', nexDots),
- new string('*', topDots));
- nexDots--;
- topDots += 2;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement