The first three letters on a luggage tag are the airport code, like PEK in PEK-0815. Write airport_code(ticket) to return those three. The tag always has at least 3 characters.
airport_code("PEK-0815")→'PEK'airport_code("LHR")→'LHR'string airport_code(const string &ticket)#include <string>
using namespace std;
string airport_code(const string &ticket) {
string code = "";
// your code here: take the first 3 characters with substr
return code;
}
Run tries the examples. When they look right, Submit.