Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. int main() {
  2.     std::map <std::string, std::vector<std::string>> buses; //key - bus, value - stops
  3.     std::map <std::string, std::vector<std::string>> stops; //key - stop, value - buses
  4.  
  5.     int Q = 0;
  6.     std::cin >> Q;
  7.  
  8.     for (int i = 0; i < Q; ++i){
  9.         std::string command;
  10.         std::cin >> command;
  11.         if (command == "NEW_BUS"){
  12.             NewBus(buses, stops);
  13.         } else if (command == "BUSES_FOR_STOP"){
  14.             string s;
  15.             std::cin >> s;
  16.             BusesForStop(s, stops);
  17.         } else if (command == "STOPS_FOR_BUS"){
  18.             std::string s;
  19.             std::cin >> s;
  20.             StopsForBus(s, buses, stops);
  21.         } else if (command == "ALL_BUSES"){
  22.             AllBuses(buses);
  23.         }
  24.     }
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement