#include <iostream> 
#include <map> 
#include <string> 
using namespace std; 

int main() 
{ 
    typedef map<int,string *> Listastudenti; 

     Listastudenti listas; 
//  Riempi la mappa
    string s1 = "Pinco Pallino";
    listas[1021130] = &s1;
    string s2= "Rossi Mario";
    listas[1001050] = &s2;
    string s3= "Verdi Giuseppe";
    listas[821102] = &s3;
// Stampa gli elementi della mappa
    Listastudenti::iterator pos; 
    for (pos = listas.begin(); pos != listas.end(); ++pos) { 
        cout << "chiave: \"" << pos->first << "\" " 
             << "valore: " << (*pos->second) << endl; 
    } 
 // Vedi se c'e' lo studente con un certo numero di matricola e stampane il nome
    int matricola=1001050;
     pos = listas.find(matricola);
     if(pos!=listas.end()){
        cout << pos->first << " " << (*pos->second)<< " trovato" << endl;}
} 


