Реферат: Сортировка массивов методом вставок
n=n+p;
}
////////////////////PrintList///////////////////
void PrintList(){
if (n==0) cout<<endl<<"List is empty."<<endl;
else{
cout<<endl;
for(int i=0; i<n; i++){
if (i%10==0) cout<<endl;
cout<<setw(3)<<*MasP[i];}
cout<<endl;
}
}
////////////////DeleteElement///////////////////
void DeleteElement(){
if (n==0) cout<<endl<<"List is empty."<<endl;
else{
cout<<endl<<"Input number of element: ";
int p;
do{
cin>>p;
if ((p<0)||(p>n)) cout<<endl<<"Error! Try again: ";}
while ((p<0)||(p>n));
cout<<endl;
for (int j=(p-1); j<n; j++)
MasP[j]=MasP[j+1];
MasP[n]=0;
n--;
}