Advertisement
zh_stoqnov

Dumbbell

Mar 30th, 2015
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 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 Problem_3
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int n = int.Parse(Console.ReadLine());
  14.  
  15. string dotsMiddle = new string('.', n);
  16. string dots = new string('.', (n - 1) / 2);
  17. string and = new string('&', n - ((n - 1) / 2));
  18. char c = '&';
  19.  
  20. Console.WriteLine(dots + and + dotsMiddle + and + dots);
  21. for (int i = 0; i < (n - 1) / 2 - 1; i++)
  22. {
  23. dots = new string('.', (n - 1) / 2 - 1 - i);
  24. string stars = new string('*', (n - 1) / 2 + i);
  25. Console.WriteLine(dots + c + stars + c + dotsMiddle + c + stars + c + dots);
  26. }
  27.  
  28. Console.WriteLine(c + new string('*', n - 2) + c + new string('=', n) + c + new string('*', n - 2) + c);
  29.  
  30. for (int i = 0; i < (n - 1) / 2 - 1; i++)
  31. {
  32. dots = new string('.', 1 + i);
  33. string stars = new string('*', n - 3 - i);
  34. Console.WriteLine(dots + c + stars + c + dotsMiddle + c + stars + c + dots);
  35. }
  36.  
  37. Console.WriteLine(new string('.', (n - 1) / 2) + and + dotsMiddle + and + new string('.', (n - 1) / 2));
  38.  
  39. }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement