Advertisement
Guest User

Untitled

a guest
Jul 9th, 2016
660
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 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 _08House
  8. {
  9. class House
  10. {
  11. static void Main(string[] args)
  12. {
  13. int n = int.Parse(Console.ReadLine());
  14. int startCount = 1;
  15. if (n % 2 == 0)
  16. {
  17. startCount++;
  18. }
  19. for (int row = 0; row < (n + 1) / 2; row++)
  20. {
  21. int dashCount = (n - startCount) / 2;
  22. Console.WriteLine(new string('-',dashCount) + new string('*',startCount) + new string('-',dashCount));
  23. startCount += 2;
  24. }
  25. for (int row = 0; row < n / 2; row++)
  26. {
  27. Console.WriteLine('|' + new string('*', n - 2) + '|');
  28. }
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement