Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace RhombusOfStars
- {
- class Program
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- for (int i = 1; i <= n; i++)
- {
- for (int j = 0; j < n - i; j++)
- {
- Console.Write(' ');
- }
- for (int k = 0; k < i; k++)
- {
- Console.Write('*');
- Console.Write(' ');
- }
- Console.WriteLine();
- }
- for (int i = n - 1; i > 0; i--)
- {
- for (int j = n - i; j > 0; j--)
- {
- Console.Write(' ');
- }
- for (int k = 0; k < i; k++)
- {
- Console.Write('*');
- Console.Write(' ');
- }
- Console.WriteLine();
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment