zh_stoqnov

NewHouseSolution

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