C++/Set: Różnice pomiędzy wersjami

Usunięta treść Dodana treść
Nie podano opisu zmian
Nie podano opisu zmian
Linia 57:
== Prosty Przykład ==
 
 
#include <iostream>
#include <string>
#include <set>
using namespace std;
int main()
{
{
set<string> mapa; //deklaracja zbioru zbiorek
mapa.insert("lublin");
mapa.insert("lodzlublin");
mapa.insert("warszawalodz");
mapa.insert("krakowwarszawa"); //dodawanie elem
mapa.insert("krakow"); //dodawanie elem
set<string>::iterator marker = mapa.find("warszawa"); //szuka elementu "warszawa"
if (marker!=mapa.end())
{
cout<<"znalazlem! "<<*marker<<endl;
}
for (marker=mapa.begin(); marker!=mapa.end(); marker++)
cout << *marker << endl;
system("pause");
return 0;
}
 
}