cout<<"Enter the gift number for the following people: "<<endl;
for(currentperson=0; currentperson<limit; currentperson++)
{
cout<<name[currentperson]<<" : ";
cin>>input;
int index = input - 1;
if(index<0 || index>4)
{
cout<<"Invalid Range"<<endl;
}
elseif(available[index])
{
available[index]=false;
count[currentperson]=index;
}
else
{
cout<<"The gift has already given to "<<name[index]<<endl;
i--;
currentperson--;
}
}