fork download
  1. #include <iostream>
  2. #include <unordered_map>
  3. #include <string>
  4.  
  5. int main(void) {
  6. std::unordered_map<std::string, std::string> name = {
  7. {"Bobby G","ugly, and stupid"},
  8. {"Billy","bad"},
  9. {"John","smart and cool"},
  10. {"Adam","amzing and beautiful"},
  11. {"Bill","perfect"},
  12. {"Turner","funny"},
  13. {"Sonny","nice"},
  14. {"Jack","radical"},
  15. {"Frank","nice"}};
  16.  
  17. std::string in;
  18. std::getline(std::cin,in);
  19. if(name.count(in)){
  20. std::cout << in << " " << name[in] << std::endl;
  21. }
  22. return 0;
  23. }
Success #stdin #stdout 0s 3480KB
stdin
Bobby G
stdout
Bobby G ugly, and stupid