学校には落とし物箱があり、box には中にあるものが並んでいます。in_the_box(box, thing) を書きましょう。find で thing を探し、あれば true、なければ false を返します。名前は大文字も含めて完全に一致する必要があります。
in_the_box({"umbrella", "scarf", "glove"}, "scarf")→Truein_the_box({"umbrella", "scarf"}, "hat")→Falsebool in_the_box(const vector<string> &box, const string &thing)#include <algorithm>
#include <string>
#include <vector>
using namespace std;
bool in_the_box(const vector<string> &box, const string &thing) {
// ここにコードを書く:find で thing を探す
return false;
}
実行すると例で試せます。よさそうなら提出しましょう。