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