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 ForestRoad
- {
- class ForestRoad
- {
- static void Main(string[] args)
- {
- int numberN = int.Parse(Console.ReadLine());
- int starPosition = 1;
- for (int j = 1; j <= (numberN * 2) - 1; j++)
- {
- for (int k = 1; k <= numberN; k++)
- {
- if (starPosition == k)
- {
- Console.Write("*");
- }
- else
- {
- Console.Write(".");
- }
- }
- if (j < numberN)
- {
- starPosition++;
- }
- else
- {
- starPosition--;
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment