Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Week3
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- for (int row = 1; row <= n; row++)
- {
- for (int col = 1; col <= n - row; col++)
- {
- Console.Write(" ");
- }
- for (int col = 0; col < row; col++)
- {
- Console.Write("* ");
- }
- Console.WriteLine();
- }
- for (int row = 1; row <= n - 1; row++)
- {
- Console.Write(new string(' ', row));
- for (int i = n - 1; i > row - 1; i--)
- {
- Console.Write("* ");
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement