zh_stoqnov

NewHouse

Oct 26th, 2014
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. using System;
  2.  
  3. namespace New_House
  4. {
  5. class NewHouse
  6. {
  7. public static void Main(string[] args)
  8. {
  9. int n = int.Parse(Console.ReadLine());
  10. for(int i = 0; i < (n + 1) / 2; i++)
  11. {
  12. string dashes = new string('-', ((n - 1) / 2) - i);
  13. string star = new string('*', 1 + (2 * i));
  14. Console.WriteLine("{0}{1}{0}", dashes, star);
  15. }
  16. for(int i = 0; i < n; i++)
  17. {
  18. string wall = "|";
  19. string asterisk = new string('*', n - 2);
  20. Console.WriteLine("{0}{1}{0}", wall, asterisk);
  21. }
  22.  
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment