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