示例#1
0
文件: minpath.c 项目: nphuc/alg
int main(){
  loadgraph();
  init();
  int i,j;
  //for(i=1;i<=n;++i) P1AI(c[i]+1,n);
  P1AI(d+1,n);
  dijkstra();
  print();
}
示例#2
0
void main() 
{ 
clrscr(); 
char ch; 
loadgraph(); 
setbkcolor(0); 
setcolor(2); 

//This do while; loop will execute untill character 'x' is not Entered
do{ 
 gotoxy(37,5); 
 cout<<"Menu"; 
 gotoxy(30,6); 
 cout<<"Stack               [s]"; 
 gotoxy(30,7); 
 cout<<"Queue               [Q]"; 
 gotoxy(30,8); 
 cout<<"Exit                [x]"; 
 gotoxy(25,9); 
 cout<<"\t\t\t\t"; 
 gotoxy(30,10); 
 cout<<"Enter Option        [ ]\b\b"; 
 ch=getche(); 
 //Converts, Entered char into lower one 
 ch = tolower(ch); 
 gotoxy(30,15); 
 if(ch=='s') 
 // call to stack function 
 stack(); 
 elseif(ch=='q') 
 //call to queue function 
 queue(); 
 cleardevice(); 

}while(ch!='x'); 
 cleardevice(); 
 closegraph(); 
}