#include #include #include using namespace std; struct Instance { string name; bool selected; Instance(const string &name) { selected=false; this->name=name; } }; int main(int argc, char **argv) { if (argc!=2) { cout << "syntax: selection \n"; exit(1); } ifstream in(argv[1]); vector list; string tmp; int nb; srandom(2008); while(in.good()) { list.clear(); in >> nb; // number of instances to select; getline(in,tmp); if (!in.good()) break; while(in.good()) { getline(in,tmp); if (tmp.length()==0) break; list.push_back(Instance(tmp)); } int i,n=0; while(n