bazzecole :sexpulp:
codice:
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
using namespace std;
int main()
{
int i;
string str;
vector<string> svec;
cout << "Inserisci una serie di linee, inserisci una linea vuota per terminare" << endl;
while(true)
{
::getline(cin, str, '\n');
if(str == "")
break;
svec.push_back(str);
}
vector<string>::iterator it;
for(i=1, it = svec.begin(); it != svec.end() ; ++it, ++i)
{
cout << setw(4) << setfill('0') << hex << i;
cout << " " << *it << endl;
}
return 0;
}