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