Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Linq;
- using System.Collections.Generic;
- using System.Text;
- namespace ConsoleApp1
- {
- class Program
- {
- static void solve(int n, int N)
- {
- int d = N - n;
- for (int i = 0; i < d/2; ++i)
- Console.Write("*");
- for (int i = 0; i < n; ++i)
- Console.Write(" ");
- for (int i = 0; i < d/2; ++i)
- Console.Write("*");
- Console.WriteLine();
- if (n > 0)
- solve(n - 2, N);
- for (int i = 0; i < d / 2; ++i)
- Console.Write("*");
- for (int i = 0; i < n; ++i)
- Console.Write(" ");
- for (int i = 0; i < d / 2; ++i)
- Console.Write("*");
- Console.WriteLine();
- }
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- if (n % 2 != 0)
- Console.WriteLine("I cant do it ;c");
- else
- {
- Console.Clear();
- solve(n, n + 2);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement