Advertisement
Guest User

Untitled

a guest
Sep 12th, 2014
605
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4.  
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int n = int.Parse(Console.ReadLine());
  10. int airHouse = ((n - 1) / 2) - 1;
  11. int middleHouse = 1;
  12.  
  13.  
  14.  
  15. Console.WriteLine("{0}*{0}", new string('.', (n - 1) / 2));
  16. for (int i = 6; i < n + 2; i = i + 2)
  17. {
  18. Console.WriteLine("{0}*{1}*{0}", new string('.', airHouse), new string('.', middleHouse));
  19. airHouse--;
  20. middleHouse = middleHouse + 2;
  21. }
  22. Console.WriteLine(new string('*', n));
  23. int outerAir = 1;
  24. for (int i = 7; i < n ; i = i + 4)
  25. {
  26. outerAir++;
  27. }
  28. int innerAir = n - (outerAir * 2) - 2;
  29.  
  30. for (int i = 1; i <= n / 3; i++)
  31. {
  32. Console.WriteLine("{0}*{1}*{0}", new string('.', outerAir), new string('.', innerAir));
  33. }
  34. Console.WriteLine("{0}{1}{0}", new string('.', outerAir), new string('*', innerAir + 2));
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement