Guest User

Untitled

a guest
Oct 21st, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. string Line = Console.ReadLine();
  13. int n = int.Parse(Line);
  14. for (int i = 1; i <= n; i++)
  15. {
  16. if (i % 2 != 0)
  17. {
  18. for (int j = 1; 2*j < i; j++)
  19. {
  20. Console.Write(".");
  21. }
  22. Console.Write("*");
  23. for (int j = i; j < n; j++)
  24. {
  25. Console.Write("*");
  26. }
  27. for (int j = 1; 2 * j < i; j++)
  28. {
  29. Console.Write(".");
  30. }
  31. Console.WriteLine();
  32. }
  33. }
  34. for (int i = n - 1; i > 0; i--)
  35. {
  36. if (i % 2 != 0)
  37. {
  38. for (int j = 1; 2*j < i; j++)
  39. {
  40. Console.Write(".");
  41. }
  42. Console.Write("*");
  43. for (int j = i; j < n; j++)
  44. {
  45. Console.Write("*");
  46. }
  47. for (int j = 1; 2 * j < i; j++)
  48. {
  49. Console.Write(".");
  50. }
  51. Console.WriteLine();
  52. }
  53. }
  54. }
  55. }
  56. }
Add Comment
Please, Sign In to add comment