#include <iostream>
#include <set>
using namespace std;
int main()
{
set<int> s = {78, 8, 9, 4, 5, 3, 65, 40};
int value = 40;
auto found = s.find(value);
if (found != s.end())
{
cout << "Value found!" << endl;
s.erase(found);
cout << "Element deleted." << endl;
}
else
{
cout << "Value not found!" << endl;
}
for (auto e : s)
{
cout << e << endl;
}
return 0;
}
Posted inC++