Эта функция выполняет симметричное вычитание компонентов как наборов:
Код: Выделить всё
template
struct symmetric_difference {
T operator ()(const T& x, const T& y) const {
return (x != y) ? x : T{};
}
};
int main() {
int n;
cout > n;
Array a = Array(n);
cout > val;
a[i] = val;
}
sort(a.begin(), a.end());
cout
Подробнее здесь: [url]https://stackoverflow.com/questions/78462528/how-to-fix-this-error-debu-assertion-failed[/url]
Мобильная версия