Advertisement
Teodor92

ForestRoad

Nov 28th, 2012
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.92 KB | None | 0 0
  1. using System;
  2.  
  3. class ForestRoad
  4. {
  5.     static void Main()
  6.     {
  7.         int n = int.Parse(Console.ReadLine());
  8.         int position = 0;
  9.         for (int i = 1; i <= n; i++)
  10.         {
  11.             position++;
  12.             for (int j = 1; j <= n; j++ )
  13.             {
  14.                 if ( position == j)
  15.                 {
  16.                     Console.Write("*");              
  17.                 }
  18.                 else
  19.                 {
  20.                     Console.Write(".");
  21.                 }
  22.             }
  23.             Console.WriteLine();
  24.         }
  25.         for (int i = 1; i < n; i++)
  26.         {
  27.             position--;
  28.             for (int j = 1; j <= n; j++)
  29.             {
  30.                 if (position == j)
  31.                 {
  32.                     Console.Write("*");
  33.                 }
  34.                 else
  35.                 {
  36.                     Console.Write(".");
  37.                 }
  38.             }
  39.             Console.WriteLine();
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement