Реферат: Сортировка массивов методом вставок
cout<<endl<<"Erase your prvious list ang try again."<<endl;}
else {cout<<endl<<"Input quantity of elements: ";
do{
cin>>n;
if ((n<1)||n>N){
cout<<endl<<"The quantity is incorrect!"<<endl;
cout<<"Max quantity of elemets: "<<N<<endl;
cout<<"Try again: ";}
}while ((n<1)||(n>N));
srand(time(NULL));
for (int i=0; i<n; i++){
MasP[i]=new int;
*MasP[i]=rand()%100;}
}
}
//////////////////AddElements///////////////////
void AddElements(){
cout<<endl<<"Input quantity of elements: ";
int p;
do{
cin>>p;
if ((p<1)||((n+p)>N)){
cout<<endl<<"The quantity is incorrect!"<<endl;
cout<<"You have "<<N-n<<" free cells."<<endl;
cout<<"Try again: ";}
}while ((p<1)||((n+p)>N));
srand(time(NULL));
for (int i=n; i<(n+p); i++){
MasP[i]=new int;