Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class ForestRoad
- {
- static void Main()
- {
- Console.WriteLine("n = ");
- int widthOfMapN = int.Parse(Console.ReadLine());
- char asterisk = '*';
- char trees = '.';
- for (int countUp = 0, countDown = widthOfMapN; countUp < widthOfMapN; countUp++, countDown--)
- {
- for (int h = 0; h < countUp; h++)
- {
- Console.Write(trees);
- }
- Console.Write(asterisk);
- for (int j = 0; j < countDown - 1; j++)
- {
- Console.Write(trees);
- }
- Console.WriteLine();
- }
- for (int countUp = 1, countDown = widthOfMapN - 1; countUp < widthOfMapN; countUp++, countDown--)
- {
- for (int h = 0; h < countDown - 1; h++)
- {
- Console.Write(trees);
- }
- Console.Write(asterisk);
- for (int h = 0; h < countUp; h++)
- {
- Console.Write(trees);
- }
- Console.WriteLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement