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 Perfect_Diamond
- {
- class Program
- {
- static void Main(string[] args)
- {
- var n = int.Parse(Console.ReadLine());
- for (int row = 0; row < n; row++)
- {
- for (int col = 1; col < n - row; col++)
- {
- Console.Write(" ");
- }
- Console.Write("*");
- for (int startCol = 0; startCol < row; startCol++)
- {
- Console.Write("-*");
- }
- Console.WriteLine();
- }
- for (int row = n - 2; row >= 0; row--)
- {
- for (int col = 1; col < n - row; col++)
- {
- Console.Write(" ");
- }
- Console.Write("*");
- for (int startCol = 0; startCol < row; startCol++)
- {
- Console.Write("-*");
- }
- Console.WriteLine();
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment