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