Advertisement
petromaxa

Untitled

Dec 11th, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace _3.Problem_ForestRoad
  7. {
  8. class Program
  9. {
  10. static void Main()
  11. {
  12. int N = int.Parse(Console.ReadLine());
  13. if (N > 1 && N < 80)
  14. {
  15. char[] dotArray = new char[N];
  16. for (int i = 0; i < N; i++)
  17. {
  18. dotArray[i] = '.';
  19. }
  20. for (int i = 0; i < N; i++)
  21. {
  22. dotArray[i] = '*';
  23. for (int j = 0; j < N; j++)
  24. {
  25. Console.Write(dotArray[j]);
  26. }
  27. dotArray[i] = '.';
  28. Console.WriteLine();
  29. }
  30. for (int i = N - 2; i >= 0; i--)
  31. {
  32. dotArray[i] = '*';
  33. for (int j = 0; j < N; j++)
  34. {
  35. Console.Write(dotArray[j]);
  36. }
  37. dotArray[i] = '.';
  38. Console.WriteLine();
  39. }
  40. }
  41. else
  42. {
  43. Console.WriteLine("Wrong entry!");
  44. }
  45. }
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement