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