#include <iostream>
#include <unordered_map>
#include <exception>
#include <string>
int main() {
const std::unordered_map<char, std::string> CoffeeSizes = {
{'S', "SMALL"},
{'M', "MEDIUM"},
{'L', "LARGE"}
};
try {
char sz;
std::cout << "Enter coffee size (S or M or L): ";
std::cin >> sz;
std::cout << "\nYou chose: " << CoffeeSizes.at(sz) << " cup sized coffee.\n";
} catch (const std::exception& e) {
std::cerr << "Invalid coffee size entered.\n";
return 1;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dW5vcmRlcmVkX21hcD4KI2luY2x1ZGUgPGV4Y2VwdGlvbj4KI2luY2x1ZGUgPHN0cmluZz4KCmludCBtYWluKCkgewogICAgY29uc3Qgc3RkOjp1bm9yZGVyZWRfbWFwPGNoYXIsIHN0ZDo6c3RyaW5nPiBDb2ZmZWVTaXplcyA9IHsKICAgICAgICB7J1MnLCAiU01BTEwifSwKICAgICAgICB7J00nLCAiTUVESVVNIn0sCiAgICAgICAgeydMJywgIkxBUkdFIn0KICAgIH07CgogICAgdHJ5IHsKICAgICAgICBjaGFyIHN6OwogICAgICAgIHN0ZDo6Y291dCA8PCAiRW50ZXIgY29mZmVlIHNpemUgKFMgb3IgTSBvciBMKTogIjsKICAgICAgICBzdGQ6OmNpbiA+PiBzejsKICAgICAgICBzdGQ6OmNvdXQgPDwgIlxuWW91IGNob3NlOiAiIDw8IENvZmZlZVNpemVzLmF0KHN6KSA8PCAiIGN1cCBzaXplZCBjb2ZmZWUuXG4iOwogICAgfSBjYXRjaCAoY29uc3Qgc3RkOjpleGNlcHRpb24mIGUpIHsKICAgICAgICBzdGQ6OmNlcnIgPDwgIkludmFsaWQgY29mZmVlIHNpemUgZW50ZXJlZC5cbiI7CiAgICAgICAgcmV0dXJuIDE7CiAgICB9CiAgICByZXR1cm4gMDsKfQ==