Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- public static void Main(string[] args)
- {
- int n=10;
- for (int row = 1; row < n; row++)
- {
- var spaces = Math.Abs(n / 2 - row);
- var stars = n / 2 - spaces;
- for (int col = 1; col <= spaces; col++)
- {
- Console.Write(" ");
- }
- for (int col = 1; col <= stars; col++)
- {
- Console.Write("* ");
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement