#include <iostream>
#include <string>
#include <vector>
#include <iterator>     // For std::ostream_iterator
#include <algorithm>  // For std::copy

using namespace std;

class StringSet
{
public:
  StringSet(vector<string> str);
  void add(string s);
  void remove(int i);
  void clear();
  int length();
  void output(ostream& outs);
private:
  vector<string> strarr;
};

StringSet::StringSet(vector<string> str)
{
  for(int k =0;k<str.size();k++)
    {
      strarr.push_back(str[k]);
    }
}
void StringSet::add(string s)
{
  strarr.push_back(s);
}
void StringSet::remove(int i)
{
  strarr.erase (strarr.begin()+(i-1));
}
void StringSet::clear()
{
  strarr.erase(strarr.begin(),strarr.end());
}
int StringSet::length()
{
  return strarr.size();
}
void StringSet::output( ostream& outs )
{
  std::copy(strarr.begin(), strarr.end(), std::ostream_iterator<string>(outs, "\n"));
}

int main()
{
  vector<string> vstr;
  string s;
  for(int i=0;i<3;i++)    // Changed the number of string to 3
    {
      cout<<"enter a string: ";
      cin>>s;
      vstr.push_back(s);
    }
  StringSet strset(vstr);
  strset.length();
  strset.add("hello");
  strset.output( std::cout );   // Write on the standard output
  strset.remove(3);
  // strset.empty();   Does not exist
  return 0;
}
