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 Practice
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- // Top side
- for (int i = 1; i <= n; i++)
- {
- Console.Write(new string(' ', n - i));
- for (int j = 0; j < i; j++)
- {
- Console.Write("* ");
- }
- Console.WriteLine(new string(' ', n - i));
- }
- // Bottom side
- for (int i = n-1 ; i >= 1; i--)
- {
- Console.Write(new string(' ', n - i));
- for (int j = 0; j < i; j++)
- {
- Console.Write("* ");
- }
- Console.WriteLine(new string(' ', n - i));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment