максимально точно можно определить элемент каталога по поисковому запросу, в котором может содержаться только часть названия и некоторые параметры
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <iterator>
using namespace std;
int main()
{
vector<string> Data = { "Audi", "A8", "4.2", "quattro", "2008" };
vector<string> Query = { "2008", "BlaBlaBla", "A8"};
vector<string> Intersection(Data.size() + Query.size());
vector<string>::iterator it;
sort(Data.begin(), Data.end());
sort(Query.begin(), Query.end());
it = set_intersection(Data.begin(), Data.end(),
Query.begin(), Query.end(),
Intersection.begin());
Intersection.resize(it - Intersection.begin());
cout << Intersection.size()<<endl;
for (string s: Intersection)
{
cout << ' ' << s;
}
getchar();
return 0;
}
2
2008 A8
Как и все предыдущие издания этой книги, настоящее издание по-прежнему адресуется серьезным программистам, которые хотели бы пользоваться Java для разработки настоящих проектов
Книга рассчитана на опытных Java-разработчиков, которым интересно, как перейти от Java 7 или 8 к Java 9.
The Definitive Guide to Java Platform Best Practices—Updated for Java 7, 8, and 9
You won’t find any technical jargon, bloated samples, drawn out history lessons or witty stories in this book. What you will find is a language reference that is concise, to the point and highly accessible. The book is packed with useful information and is a must-have for any Java programmer.