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;
- class forestRoad
- {
- static void Main(string[] args)
- {
- byte N = byte.Parse(Console.ReadLine());
- if (N < 1 || N > 80)
- {
- return;
- }
- uint heith = (uint)2 * N - 1;
- int pointsBeforeCount = 0;
- int pointsAfterCount = N - 1;
- string direction = "right";
- string pointsBefore = "";
- string pointsAfter = "";
- for (int i = 1; i <= heith; i++)
- {
- if (direction.Equals("right"))
- {
- pointsBefore = new string('.', pointsBeforeCount);
- pointsAfter = new string('.', (N - (pointsBeforeCount + 1)));
- pointsBeforeCount++;
- if (pointsBeforeCount == N)
- {
- pointsBeforeCount = N - 2;
- direction = "left";
- }
- }
- else if (direction.Equals("left"))
- {
- pointsBefore = new string('.', pointsBeforeCount);
- pointsAfter = new string('.', (N - (pointsBeforeCount + 1)));
- pointsBeforeCount--;
- if (pointsBeforeCount == 0)
- {
- pointsBeforeCount = 0;
- direction = "right";
- }
- }
- Console.WriteLine("{0}*{1}", pointsBefore, pointsAfter);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement