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 RhombusOfStars
- {
- class RhombusOFStars
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- for (int row = 0; row < n; row++)
- {
- Console.Write(new string(' ', n - row - 1));
- for (int col = 0; col <=row; col++)
- {
- Console.Write("* ");
- }
- Console.WriteLine();
- }
- for (int row = n-2; row >=0; row--)
- {
- Console.Write(new string(' ', n - row - 1));
- for (int col = 0; col <= row; col++)
- {
- Console.Write("* ");
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment