Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <set>
- using namespace std;
- int main() {
- string line, command, numberPlate;
- getline(cin, line);
- set<string> numberPlates;
- while (line != "END") {
- command = line.substr(0, line.find(','));
- numberPlate = line.substr(line.find(',') + 2);
- numberPlates.insert(numberPlate);
- if (command == "OUT") {
- numberPlates.erase(numberPlate);
- }
- getline(cin, line);
- }
- if (numberPlates.empty()) {
- cout << "Parking Lot is Empty\n";
- }
- for (auto& n : numberPlates) {
- cout << n << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement