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