资源描述:
《电子地图管理系统.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、最新最全电子地图管理系统usingnamespacestd;voidstart();voiddisplay();voiddisplaypaixu();voiddisplayjiansuo();Road*head=NULL;voidSearchByClass(Road*head){time_ta,b;Road*prev,*p,*end,*temp_head;charRun_time[80];inti=0,Class;printf("请输入您所要查找的道路的番号:");scanf("%d",&Class);prev=p=(Road*)malloc(sizeof(Road));//创建一个
2、结点a=time(NULL);strftime(Run_time,79,"%H:%M:%S",localtime(&a));temp_head=head;36最新最全if(temp_head==NULL){printf("无数据源");system("pause");exit(5);}while(temp_head!=NULL){if(temp_head->stRoadRec.linkid==Class){end=(Road*)malloc(sizeof(Road));printf("#linkid=%d",temp_head->stRoadRec.LinkID);printf("roa
3、dnameflag=%d",temp_head->stRoadRec.roadnameflag);printf("brunch=%d",temp_head->stRoadRec.brunch);printf("dispclass=%d",temp_head->stRoadRec.linkid);printf("roadname=%s#",temp_head->stRoadRec.roadname);p->stRoadRec.LinkID=temp_head->stRoadRec.LinkID;p->stRoadRec.roadnameflag=temp_head->stRoadRec
4、.roadnameflag;p->stRoadRec.brunch=temp_head->stRoadRec.brunch;36最新最全p->stRoadRec.linkid=temp_head->stRoadRec.linkid;p->stRoadRec.roadname=temp_head->stRoadRec.roadname;p->next=end;p=p->next;i++;}temp_head=temp_head->next;}end->next=NULL;p->next=NULL;if(i>=5){save(prev);printf("查询结果数大于5,已保存至Search
5、Result.txt");}b=time(NULL);strftime(Run_time,79,"%H:%M:%S",localtime(&b));36最新最全printf("本次查找用时%d秒.",b-a);}voidSearchById(Road*head){time_ta,b;Road*prev,*p,*end,*temp_head;charRun_time[80];inti=0,LinkId;printf("请输入您所要查找的道路的ID:");scanf("%d",&LinkId);prev=p=(Road*)malloc(sizeof(Road));//创建一个结点
6、a=time(NULL);strftime(Run_time,79,"%H:%M:%S",localtime(&a));temp_head=head;if(temp_head==NULL){printf("无数据源");36最新最全system("pause");exit(3);}while(temp_head!=NULL){if(temp_head->stRoadRec.LinkID==LinkId){end=(Road*)malloc(sizeof(Road));printf("#linkid=%d",temp_head->stRoadRec.LinkID);printf("road
7、nameflag=%d",temp_head->stRoadRec.roadnameflag);printf("brunch=%d",temp_head->stRoadRec.brunch);printf("dispclass=%d",temp_head->stRoadRec.linkid);printf("roadname=%s#",temp_head->stRoadRec.roadname);p->stRoadRec.Lin