stream iterator in c++, program using stream iterator in C++

stream iterator in c++, program using stream iterator in C++



#include
#include
#include
#include
#include

using namespace std;

int main()
{
vector coll;
copy (istream_iterator(cin), //start of the source
istream_iterator(), //end of the source
back_inserter(coll)); //Final destination... :)

//To sort the elements
sort (coll.begin(), coll.end());
unique_copy (coll.begin(), coll.end(), //source
ostream_iterator (cout, "\n"));
//destination
return 0;
}


No comments:

Post a Comment