Advertisement
Guest User

Untitled

a guest
Jun 12th, 2015
461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. {
  2. static void Main()
  3. {
  4. int n = int.Parse(Console.ReadLine());
  5. Console.WriteLine("{0}{1}{0}",new string('.',(n - 1) / 2),'*');
  6. for (int i = 1; i <= ((n - 1) / 2) - 1; i++)
  7. {
  8. Console.WriteLine("{0}{1}{2}{1}{0}",new string('.', ((n - 1) / 2)-i),'*',new string('.', (2 * i) - 1));
  9. }
  10. Console.WriteLine("{0}", new string('*',n));
  11. if (n == 5)
  12. {
  13. Console.WriteLine("{0}{1}{0}{1}{0}", '.', '*');
  14. Console.WriteLine("{0}{1}{0}", '.', new string('*', 3));
  15. }
  16. else
  17. {
  18. for (int j = 1; j <= ((n - 1) / 2) - 1; j++)
  19. {
  20. Console.WriteLine("{0}{1}{2}{1}{0}", new string('.',(n - 5) / 2),'*',new string('.', 3 ));
  21. }
  22.  
  23. Console.WriteLine("{0}{1}{0}", new string('.', (n - 5) / 2), new string('*', 5));
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement