You are viewing a single comment's thread. Return to all comments →
if '~' is replaced with '.' in query string, we can modify processing of query like this:
'~'
'.'
void process_queries(int q, std::map <std::string, std::string> &attributes) { std::string str; for (int i = 0; i < q; i++) { getline(std::cin, str); if (attributes.find(str) == attributes.end()) { size_t pos = str.find("~"); if (pos != std::string::npos) { str[pos] = '.'; if (attributes.find(str) != attributes.end()) { std::cout << attributes[str] << "\n"; } } std::cout << "Not Found!\n"; } else { std::cout << attributes[str] << "\n"; } } }
Seems like cookies are disabled on this browser, please enable them to open this website
Attribute Parser
You are viewing a single comment's thread. Return to all comments →
if
'~'
is replaced with'.'
in query string, we can modify processing of query like this: