#include<iostream>
#include<set>
#include<iterator>
using namespace std;
int main()
{
set<string>a;
set<string> :: iterator r;
a.insert("Anik");
a.insert("Shawon");
a.insert("Nahid");
a.insert("Anan");
pair<set<string> :: iterator, bool > p;
p = a.insert("Anan");
if(p.second == true)
{
cout << "Insert" << endl << endl;
}
else
{
cout << "Not Insert" << endl << endl;
}
for(r=a.begin(); r!=a.end(); r++)
{
cout << *r << "\t";
}
cout << endl;
return 0;
}
#include<set>
#include<iterator>
using namespace std;
int main()
{
set<string>a;
set<string> :: iterator r;
a.insert("Anik");
a.insert("Shawon");
a.insert("Nahid");
a.insert("Anan");
pair<set<string> :: iterator, bool > p;
p = a.insert("Anan");
if(p.second == true)
{
cout << "Insert" << endl << endl;
}
else
{
cout << "Not Insert" << endl << endl;
}
for(r=a.begin(); r!=a.end(); r++)
{
cout << *r << "\t";
}
cout << endl;
return 0;
}
Comments
Post a Comment