Advertisement
KristianIvanov00

Task02_Homework4

Mar 12th, 2023
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.49 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Task02
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. String EGN = Console.ReadLine();
  10. int genderNum = int.Parse(EGN.Substring(8, 1));
  11.  
  12. int cityNumbers = int.Parse(EGN.Substring(6, 3));
  13. String gender = "";
  14. String city = "";
  15. if (genderNum % 2 == 0)
  16. {
  17. gender = "man";
  18. }
  19. else
  20. {
  21. gender = "woman";
  22. }
  23.  
  24.  
  25. if (cityNumbers >= 0 && cityNumbers <= 43)
  26. {
  27. city = "Благоевград";
  28. }
  29. else if (cityNumbers > 43 && cityNumbers <= 93)
  30. {
  31. city = "Бургас";
  32. }
  33. else if (cityNumbers > 93 && cityNumbers <= 139)
  34. {
  35. city = "Варна";
  36. }
  37. else if (cityNumbers > 139 && cityNumbers <= 169)
  38. {
  39. city = "Велико Търново";
  40. }
  41. else if (cityNumbers > 169 && cityNumbers <= 183)
  42. {
  43. city = "Видин";
  44. }
  45. else if (cityNumbers > 183 && cityNumbers <= 217)
  46. {
  47. city = "Враца";
  48. }
  49. else if (cityNumbers > 217 && cityNumbers <= 233)
  50. {
  51. city = "Габрово";
  52. }
  53. else if (cityNumbers > 233 && cityNumbers <= 281)
  54. {
  55. city = "Кърджали";
  56. }
  57. else if (cityNumbers > 281 && cityNumbers <= 301)
  58. {
  59. city = "Кюстендил";
  60. }
  61. else if (cityNumbers > 301 && cityNumbers <= 319)
  62. {
  63. city = "Ловеч";
  64. }
  65. else if (cityNumbers > 319 && cityNumbers <= 341)
  66. {
  67. city = "Монтана";
  68. }
  69. else if (cityNumbers > 341 && cityNumbers <= 377)
  70. {
  71. city = "Пазарджик";
  72. }
  73. else if (cityNumbers > 377 && cityNumbers <= 395)
  74. {
  75. city = "Перник";
  76. }
  77. else if (cityNumbers > 395 && cityNumbers <= 435)
  78. {
  79. city = "Плевен";
  80. }
  81. else if (cityNumbers > 435 && cityNumbers <= 501)
  82. {
  83. city = "Пловдив";
  84. }
  85. else if (cityNumbers > 501 && cityNumbers <= 527)
  86. {
  87. city = "Разград";
  88. }
  89. else if (cityNumbers > 527 && cityNumbers <= 555)
  90. {
  91. city = "Русе";
  92. }
  93. else if (cityNumbers > 555 && cityNumbers <= 575)
  94. {
  95. city = "Силистра";
  96. }
  97. else if (cityNumbers > 575 && cityNumbers <= 601)
  98. {
  99. city = "Сливен";
  100. }
  101. else if (cityNumbers > 601 && cityNumbers <= 623)
  102. {
  103. city = "Смолян";
  104. }
  105. else if (cityNumbers > 623 && cityNumbers <= 721)
  106. {
  107. city = "София-град";
  108. }
  109. else if (cityNumbers > 721 && cityNumbers <= 751)
  110. {
  111. city = "София-окръг";
  112. }
  113. else if (cityNumbers > 751 && cityNumbers <= 789)
  114. {
  115. city = "Стара Загора";
  116. }
  117. else if (cityNumbers > 789 && cityNumbers <= 821)
  118. {
  119. city = "Добрич(Толбухин)";
  120. }
  121. else if (cityNumbers > 821 && cityNumbers <= 843)
  122. {
  123. city = "Търговище";
  124. }
  125. else if (cityNumbers > 843 && cityNumbers <= 871)
  126. {
  127. city = "Хасково";
  128. }
  129. else if (cityNumbers > 871 && cityNumbers <= 903)
  130. {
  131. city = "Шумен";
  132. }
  133. else if (cityNumbers > 903 && cityNumbers <= 925)
  134. {
  135. city = "Ямбол";
  136. }
  137. else if (cityNumbers > 926 && cityNumbers <= 999)
  138. {
  139. city = "Друг/Неизвестен";
  140. }
  141.  
  142.  
  143. Console.WriteLine(gender);
  144. Console.WriteLine(city);
  145. }
  146. }
  147. }
  148.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement