zh_stoqnov

PandaScotlandFlag

Nov 1st, 2014
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. using System;
  2.  
  3. namespace PandaScotlandFlag
  4. {
  5. class PandaScotlandFlag
  6. {
  7. public static void Main(string[] args)
  8. {
  9. int n = int.Parse(Console.ReadLine());
  10. char printChar = 'A';
  11. char lastChar = ' ';
  12. if(n == 1)
  13. {
  14. Console.WriteLine(printChar);
  15. }
  16. for(int i = 0; i < (n - 1)/2; i++)
  17. {
  18. string diez = new string('#', n - 2 - 2 * i);
  19. string sym = new string('~', i);
  20. Console.Write(sym);
  21. Console.Write(printChar);
  22. if(printChar == 'Z')
  23. {
  24. printChar = 'A';
  25. }
  26. else
  27. {
  28. printChar++;
  29. }
  30. Console.Write(diez);
  31. Console.Write(printChar);
  32. if(printChar == 'Z')
  33. {
  34. printChar = 'A';
  35. }
  36. else
  37. {
  38. printChar++;
  39. }
  40. Console.Write(sym);
  41. Console.WriteLine();
  42. lastChar = printChar;
  43. }
  44. string dash = new string('-', (n - 1) /2);
  45. Console.WriteLine(dash + lastChar + dash);
  46. lastChar++;
  47. for(int i = 0; i < (n - 1) / 2; i++)
  48. {
  49. string sym = new string('~', (n - 3) / 2 - i);
  50. string diez = new string('#', (1 + 2 * i));
  51. Console.Write(sym);
  52. Console.Write(lastChar);
  53. if(lastChar == 'Z')
  54. {
  55. lastChar = 'A';
  56. }
  57. else
  58. {
  59. lastChar++;
  60. }
  61. Console.Write(diez);
  62. Console.Write(lastChar);
  63. if(lastChar == 'Z')
  64. {
  65. lastChar = 'A';
  66. }
  67. else
  68. {
  69. lastChar++;
  70. }
  71. Console.Write(sym);
  72. Console.WriteLine();
  73. }
  74.  
  75. }
  76. }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment