1 セットの文字列と、2 番目の文字列があります。そして、そのセットを反復処理して、現在の文字列がその 2 番目の文字列に含まれているかどうかを判断したいと思います。STL
これらのインクルードのいずれかから、またはそのいずれかから、作業を容易にするツールはありますか?
#include <cctype>
#include <iostream>
#include <iomanip>
#include <set>
#include <list>
#include <map>
#include <vector>
#include <queue>
#include <string>
使用事例:
test1 . Add ( 0, "hello" );
test1 . Add ( 1, "world" );
test1 . Add ( 2, "rld" );
test1 . Add ( 3, "ell" );
test1 . Add ( 4, "hell" );
printSet ( test1 . Search ( "hello world!" ) );
// 0, 1, 2, 3, 4
printSet ( test1 . Search ( "hEllo world!" ) );
// 1, 2
もちろん、文字列ごと、文字ごとに比較したり、オートマトンを作成したりできますが、実際よりも難しくする必要があります:)