Advertisement
pgiovanni

Untitled

Sep 27th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.71 KB | None | 0 0
  1. #include <iostream>
  2. #include<string>
  3. #include<algorithm>
  4. #include<vector>
  5.  
  6. using namespace std;
  7.  
  8.  
  9. vector<string> populate_route_28(vector<string> route_28) {
  10.  
  11. string one = "101a Hastings way";
  12. string two = "101b Hastings way";
  13. string three = "102a Hastings way";
  14. string four = "102b Hastings way";
  15. string five = "103a Hastings way";
  16. string six = "103b Hastings way";
  17. string seven = "104a Hastings way";
  18. string eight = "104b Hastings way";
  19. string nine = "105a Hastings way";
  20. string ten = "105b Hastings way";
  21. string eleven = "106a Hastings way";
  22. string twelve = "106b Hastings way";
  23. string thirteen = "107a Hastings way";
  24. string fourteen = "107b Hastings way";
  25. string fifteen = "108a Hastings way";
  26. string sixteen = "108b Hastings way";
  27. string seventeen = "109a Hastings way";
  28. string eighteen = "109b Hastings way";
  29. string nineteen = "110a Hastings way";
  30. string twenty = "110b Hastings way";
  31. string twenty_one = "111a Hastings way";
  32. string twenty_two = "111b Hastings way";
  33. string twenty_three = "112a Hastings way";
  34. string twenty_four = "112b Hastings way";
  35. string twenty_five = "113a Hastings way";
  36. string twenty_six = "113b Hastings way";
  37. string twenty_seven = "114a Hastings way";
  38. string twenty_eight = "114b Hastings way";
  39. string twenty_nine = "115a Hastings way";
  40. string thirty = "115b Hastings way";
  41. string thirty_one = "116a Hastings way";
  42. string thirty_two = "116b Hastings way";
  43. string thirty_three = "307a Hastings way";
  44. string thirty_four = "307b Hastings way";
  45. string thirty_five = "308a Hastings way";
  46. string thirty_six = "308b Hastings way";
  47. string thirty_seven = "309a Hastings way";
  48. string thirty_eight = "309b Hastings way";
  49. string thirty_nine = "310a Hastings way";
  50. string fourty = "310b Hastings way";
  51. string fourty_one = "311a Hastings way";
  52. string fourty_two = "311b Hastings way";
  53. string fourty_three = "312a Hastings way";
  54. string fourty_four = "312b Hastings way";
  55. string fourty_five = "301a Hastings way";
  56. string fourty_six = "301b Hastings way";
  57. string fourty_seven = "302a Hastings way";
  58. string fourty_eight = "302b Hastings way";
  59. string fourty_nine = "303a Hastings way";
  60. string fifty = "303b Hastings way";
  61. string fifty_one = "304a Hastings way";
  62. string fifty_two = "304b Hastings way";
  63. string fifty_three = "305a Hastings way";
  64. string fifty_four = "305b Hastings way";
  65. string fifty_five = "306a Hastings way";
  66. string fifty_six = "306b Hastings way";
  67. string fifty_seven = "209a Hastings way";
  68. string fifty_eight = "209b Hastings way";
  69. string fifty_nine = "210a Hastings way";
  70. string sixty = "210b Hastings way";
  71. string sixty_one = "211a Hastings way";
  72. string sixty_two = "211b Hastings way";
  73. string sixty_three = "212a Hastings way";
  74. string sixty_four = "212b Hastings way";
  75. string sixty_five = "213a Hastings way";
  76. string sixty_six = "213b Hastings way";
  77. string sixty_seven = "214a Hastings way";
  78. string sixty_eight = "214b Hastings way";
  79. string sixty_nine = "215a Hastings way";
  80. string seventy = "215b Hastings way";
  81. string seventy_one = "216a Hastings way";
  82. string seventy_two = "216b Hastings way";
  83. string seventy_three = "201a Hastings way";
  84. string seventy_four = "201b Hastings way";
  85. string seventy_five = "202a Hastings way";
  86. string seventy_six = "202b Hastings way";
  87. string seventy_seven = "203a Hastings way";
  88. string seventy_eight = "203b Hastings way";
  89. string seventy_nine = "204a Hastings way";
  90. string eighty = "204b Hastings way";
  91. string eighty_one = "205a Hastings way";
  92. string eighty_two = "205b Hastings way";
  93. string eighty_three = "206a Hastings way";
  94. string eighty_four = "206b Hastings way";
  95. string eighty_five = "207a Hastings way";
  96. string eight_six = "207b Hastings way";
  97. string eighty_six = "208a Hastings way";
  98. string eighty_seven = "208b Hastings way";
  99. string eighty_eight;
  100.  
  101. route_28.push_back(one);
  102. route_28.push_back(two);
  103. route_28.push_back(three);
  104. route_28.push_back(four);
  105. route_28.push_back(five);
  106. route_28.push_back(six);
  107. route_28.push_back(seven);
  108. route_28.push_back(eight);
  109. route_28.push_back(nine);
  110. route_28.push_back(ten);
  111. route_28.push_back(eleven);
  112. route_28.push_back(twelve);
  113. route_28.push_back(thirteen);
  114. route_28.push_back(fourteen);
  115. route_28.push_back(fifteen);
  116. route_28.push_back(sixteen);
  117. route_28.push_back(seventeen);
  118. route_28.push_back(eighteen);
  119. route_28.push_back(nineteen);
  120. route_28.push_back(twenty);
  121. route_28.push_back(twenty_one);
  122. route_28.push_back(twenty_two);
  123. route_28.push_back(twenty_three);
  124. route_28.push_back(twenty_four);
  125. route_28.push_back(twenty_five);
  126. route_28.push_back(twenty_six);
  127. route_28.push_back(twenty_seven);
  128. route_28.push_back(twenty_eight);
  129. route_28.push_back(twenty_nine);
  130. route_28.push_back(thirty);
  131. route_28.push_back(thirty_one);
  132. route_28.push_back(thirty_two);
  133. route_28.push_back(thirty_three);
  134. route_28.push_back(thirty_four);
  135. route_28.push_back(thirty_five);
  136. route_28.push_back(thirty_six);
  137. route_28.push_back(thirty_seven);
  138. route_28.push_back(thirty_eight);
  139. route_28.push_back(thirty_nine);
  140. route_28.push_back(fourty);
  141. route_28.push_back(fourty_one);
  142. route_28.push_back(fourty_two);
  143. route_28.push_back(fourty_three);
  144. route_28.push_back(fourty_four);
  145. route_28.push_back(fourty_five);
  146. route_28.push_back(fourty_six);
  147. route_28.push_back(fourty_seven);
  148. route_28.push_back(fourty_eight);
  149. route_28.push_back(fourty_nine);
  150. route_28.push_back(fifty);
  151. route_28.push_back(fifty_one);
  152. route_28.push_back(fifty_two);
  153. route_28.push_back(fifty_three);
  154. route_28.push_back(fifty_four);
  155. route_28.push_back(fifty_five);
  156. route_28.push_back(fifty_six);
  157. route_28.push_back(fifty_seven);
  158. route_28.push_back(fifty_eight);
  159. route_28.push_back(fifty_nine);
  160. route_28.push_back(sixty);
  161. route_28.push_back(sixty_one);
  162. route_28.push_back(sixty_two);
  163. route_28.push_back(sixty_three);
  164. route_28.push_back(sixty_four);
  165. route_28.push_back(sixty_five);
  166. route_28.push_back(sixty_six);
  167. route_28.push_back(sixty_seven);
  168. route_28.push_back(sixty_eight);
  169. route_28.push_back(sixty_nine);
  170. route_28.push_back(seventy);
  171. route_28.push_back(seventy_one);
  172. route_28.push_back(seventy_two);
  173. route_28.push_back(seventy_three);
  174. route_28.push_back(seventy_four);
  175. route_28.push_back(seventy_five);
  176. route_28.push_back(seventy_six);
  177. route_28.push_back(seventy_seven);
  178. route_28.push_back(seventy_eight);
  179. route_28.push_back(seventy_nine);
  180. route_28.push_back(eighty);
  181. route_28.push_back(eighty_one);
  182. route_28.push_back(eighty_two);
  183. route_28.push_back(eighty_three);
  184. route_28.push_back(eighty_four);
  185. route_28.push_back(eighty_five);
  186. route_28.push_back(eighty_six);
  187. route_28.push_back(eighty_seven);
  188.  
  189. return route_28;
  190. }
  191.  
  192. void get_packages() {
  193. vector<int> package_indexes;
  194. vector<string> Route_28;
  195. string one_package_in;
  196. bool continue_scanning = true;
  197. cout << "Input the packges." << endl;
  198. cout << "Input \"stop\" to stop." << endl;
  199. Route_28 = populate_route_28(Route_28);
  200.  
  201. do {
  202.  
  203.  
  204.  
  205. getline(cin, one_package_in);
  206. if (one_package_in == "stop")
  207. continue_scanning = false;
  208. for (unsigned int package_index = 0; package_index < Route_28.size(); ++package_index) {
  209.  
  210. if (one_package_in == Route_28[package_index])
  211. package_indexes.push_back(package_index);
  212. }
  213.  
  214.  
  215. if (find(Route_28.begin(), Route_28.end(), one_package_in) == Route_28.end())
  216. cout << "Package is not on this route. Check your spelling." << endl;
  217.  
  218.  
  219. } while (continue_scanning);
  220.  
  221. sort(package_indexes.begin(), package_indexes.end());
  222.  
  223.  
  224. for (unsigned int i = 0; i < package_indexes.size(); ++i)
  225.  
  226. cout << "Stop: " + to_string(++i) + Route_28[package_indexes[i]] << endl;
  227.  
  228. }
  229.  
  230.  
  231. int main(int argc, char** argv) {
  232. get_packages();
  233.  
  234. return 0;
  235. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement