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