Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Draw(int num, int lel)
- {
- if (num > lel)
- {
- for (int i = num; i > lel; i--)
- {
- Console.Write("*");
- }
- Console.WriteLine();
- Draw(num - 1, lel);
- }
- if (num < lel)
- {
- for (int i = lel - num; i < lel; i++)
- {
- Console.Write("*");
- }
- Console.WriteLine();
- Draw(num + 1, lel);
- }
- }
- static void DrawMain(int num)
- {
- Draw(num, 0);
- Draw(2, num);
- }
- static void Main(string[] args)
- {
- DrawMain(5);
- Console.ReadKey();
- }
- }
Add Comment
Please, Sign In to add comment