wrong answer #8 - solved
#include <bits/stdc++.h>
using namespace std;
int main()
{int x;
vector <string> myvector (2001);
fill (myvector.begin(),myvector.begin()+5,"few");
fill (myvector.begin()+6,myvector.begin()+10,"several");
fill (myvector.begin()+11,myvector.begin()+20,"pack");
fill (myvector.begin()+21,myvector.begin()+50,"lots");
fill (myvector.begin()+51,myvector.begin()+100,"horde");
fill (myvector.begin()+101,myvector.begin()+250,"throng");
fill (myvector.begin()+251,myvector.begin()+500,"swarm");
fill (myvector.begin()+501,myvector.begin()+1000,"zounds");
fill (myvector.begin()+1001,myvector.end(),"legion");
cin>>x;
cout<<myvector[x];
return 0;
}
correct solution:
#include <bits/stdc++.h>
using namespace std;
int main()
{int x;
vector <string> myvector (2001);
fill (myvector.begin(),myvector.begin()+5,"few");
fill (myvector.begin()+5,myvector.begin()+10,"several");
fill (myvector.begin()+10,myvector.begin()+20,"pack");
fill (myvector.begin()+20,myvector.begin()+50,"lots");
fill (myvector.begin()+50,myvector.begin()+100,"horde");
fill (myvector.begin()+100,myvector.begin()+250,"throng");
fill (myvector.begin()+250,myvector.begin()+500,"swarm");
fill (myvector.begin()+500,myvector.begin()+1000,"zounds");
fill (myvector.begin()+1000,myvector.end(),"legion");
cin>>x;
cout<<myvector[x]<<endl;;
return 0;
}
Edited by author 30.09.2017 07:20