Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Diamond
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- var chertichki = (n - 1) / 2;
- for (int i = 1; i <= (n - 1) / 2; i++)
- {
- Console.Write(new string('-', chertichki));
- Console.Write("*");
- var mid = n - 2 * chertichki - 2;
- if (mid >= 0)
- {
- Console.Write(new string('-', mid));
- Console.Write("*");
- }
- Console.WriteLine(new string('-', chertichki));
- chertichki--;
- }
- for (int i = n / 2; i < n; i++)
- {
- Console.Write(new string('-', chertichki));
- Console.Write("*");
- var mid = n - 2 * chertichki - 2;
- if (mid >= 0)
- {
- Console.Write(new string('-', mid));
- Console.Write("*");
- }
- Console.WriteLine(new string('-', chertichki));
- chertichki++;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement