Реферат: Сортировка массивов методом вставок
SaveList();
}
/////////////////SortByDecrease//////////////////
void SortByDecrease(){
int buf;
for (int i=0; i<(n-1); i++){
if (*MasP[i]<*MasP[i+1]){
SaveList();
buf=*MasP[i+1];
for (int j=0; j<(i+1); j++){
if (buf>*MasP[j]){
for (int q=i+1; q>j; q--)
*MasP[q]=*MasP[q-1];
*MasP[j]=buf;
break;
}//Incert place
}//for Incert place
}//Find unsorted element
}//for Find unsorted element
SaveList();
}
///////////////////Open File/////////////////////
void OpenList(char s[20]){
if (n!=0) {cout<<endl<<"Error! You have existing list.";
cout<<endl<<"Erase your prvious list ang try again."<<endl;}
else {
if (argcGlobal<3){
cout<<endl<<"Input file name: ";
char *FileName=new char[20];