Advertisement
davichonov365

Untitled

Aug 13th, 2016
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace House
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int n = int.Parse(Console.ReadLine());
  14. var stars = 1;
  15. if (n % 2 == 0)
  16. {
  17. stars = 2;
  18. }
  19. for (int row = 0; row < (n + 1) / 2; row++)
  20. {
  21. var dashes = (n - stars) / 2;
  22. Console.Write(new string('-', dashes));
  23. Console.Write(new string('*', stars));
  24. Console.Write(new string('-', dashes));
  25. Console.WriteLine();
  26. stars = stars + 2;
  27. }
  28. var bodyrows = n - (n + 1) / 2;
  29. for (int row = 0; row < n / 2; row++)
  30. {
  31. Console.Write("|");
  32. Console.Write(new string('*', n - 2));
  33. Console.WriteLine("|");
  34.  
  35. }
  36. }
  37.  
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement