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