Транспортная задача
Категория реферата: Рефераты по информатике, программированию
Теги реферата: хозяйство реферат, отчет по практике
Добавил(а) на сайт: Rjurik.
Предыдущая страница реферата | 1 2 3 4 5 6 | Следующая страница реферата
else if((nst=levpoisk(ik,jk))>=0)
{ fprintf(fil,"LEFT:Point found !n"); printf("LEFT:Point found !nr"); napr = 4; jk = nst; top2->prnapr = 3;
}
// **************** Prodolzhenie 1 poiska *********************** else if((nstr = verpoisk(ik,jk))>=0)
{ fprintf(fil,"UP:Point found !n"); printf("UP:Point found !nr"); napr = 1; ik = nstr; top2->prnapr = 4;
} else return(-1);
while(!fl || *(matr2+ik*n+jk)!=-1)
{ fl=1; switch(napr)
{ case 1: printf("Search to the right --->"); fprintf(fil,"Search to the right --->"); if((nst = prpoisk(ik,jk))>=0)
{ printf("foundednr"); fprintf(fil,"foundedn"); if((top2=(struct cik*)malloc(sizeof(struct cik)))==NULL) abort(); if(!topnast1) topnast1=top2; else top3 -> next=top2; top3 = top2; top2 -> next = NULL; top2->ick = ik; top2->jck = jk; ch++; top2->prnapr = 1; pr("top2",top2); napr = 2; jk = nst; perpr = perlev = 0;
} // **** IF ******* else
{ fprintf(fil,"Point not found ! Change direction to LEFTn"); napr = 3; perpr = 1;
} break;
//***************** PRODOLZHENIE 2 POISKA
****************************** case 2: printf("Search to the down --->"); fprintf(fil,"Search to the down --->"); if((nstr=nizpoisk(ik,jk))>=0)
{ if((top2=(struct cik*)malloc(sizeof(struct cik))) ==
NULL) abort(); printf("foundednr"); fprintf(fil,"foundedn"); if(!topnast1) topnast1=top2; else top3->next=top2; top3=top2; top2->next=NULL; top2->ick = ik; top2->jck = jk; ch++; top2->prnapr = 2; pr("top2",top2); napr = 3; ik = nstr; perniz=perver=0;
} //**** IF ******** else
{ fprintf(fil,"Point not found ! Change direction to UPn"); napr = 4; perniz = 1;
} break;
case 3: printf("Search to the left -->"); fprintf(fil,"Search to the left -->"); if((nst=levpoisk(ik,jk))>=0)
{ if((top2=(struct cik*)malloc(sizeof(struct cik))) == NULL) abort(); printf("foundednr"); fprintf(fil,"foundedn"); if(!topnast1) topnast1=top2; else top3->next=top2; top3=top2; top2->next=NULL; top2->ick = ik; top2->jck = jk; ch++;
//************ PRODOLZHENIE 3 POISKA ************* top2->prnapr = 3; pr("top2",top2); napr = 4; jk = nst; perlev = perpr = 0;
} // ******* IF ***** else{ fprintf(fil,"Point not found ! Change direction to RIGHTn"); napr = 1; perlev = 1;
} break; case 4: printf("Search to the up --->"); fprintf(fil,"Search to the up --->"); if((nstr=verpoisk(ik,jk))>=0)
{ if((top2=(struct cik*)malloc(sizeof(struct cik)))==NULL) abort(); printf("foundednr"); fprintf(fil,"foundedn"); if(!topnast1) topnast1=top2; else top3->next=top2; top3=top2; top2->next=NULL; top2->ick=ik; top2->jck=jk; ch++; top2->prnapr = 4; pr("top2",top2); napr = 1; ik = nstr; perver = perniz = 0;
} // *****If ************** else
Рекомендуем скачать другие рефераты по теме: отчет по производственной практике, экология реферат.
Предыдущая страница реферата | 1 2 3 4 5 6 | Следующая страница реферата