⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mymap.cpp

📁 数据结构实验课中的所有实验程序
💻 CPP
字号:

#include "stdafx.h"
#include "Graph.h"
#include "windows.h"

int main(int argc, char* argv[])
{
    Graph GG;
	GG.load();
	int xx;
	do
	{
		system("cls");       
		cout<<"\t\t Touring Guidance"<<endl;
        cout<<"                    "<<endl;
		cout<<" Hello,welcome to Beijing Forestry Univercity !"<<endl;
		cout<<" I'm pleased to be your assistance.       "<<endl;
		cout<<" Please try some of the functions enumerated below if necessary. "<<endl;
		cout<<"                    "<<endl;	
	    cout<<"1.The list about all the sights you can enjoy."<<endl;
     	cout<<"2.The detailed information about some sights that interested you. "<<endl;
	    cout<<"3.Suposing setting cable."<<endl;
        cout<<"4.Finding the shorcut between two sights."<<endl;
	    cout<<"5.Exit."<<endl;
        cout<<"                    "<<endl;	
		cout<<"Would you like to have a try?  What's your choice?"<<endl;
	    cin>>xx;
	    switch(xx)
		 {
	        case 1:
				{
				   cout<<"Here are all the sights:"<<endl;
				   GG.Components();
				   cout<<endl;
				   cout<<"-------------------------"<<endl;
				   cout<<"It will be closed 5 seconds later....."<<endl;
				}break;
		    case 2:
				{
					char iname[50];
					cout<<"Please enter the name of the sights interested you:"<<endl;
					cin>>iname;
					GG.SearchInfo(iname);
					cout<<"-------------------------"<<endl;
					cout<<"It will be closed 5 seconds later....."<<endl;
				}break;
            case 3:
				{
					cout<<"The length of the cable line is:";
					MinSpanTree mst(20);
	                GG.Prim(mst);
					cout<<endl;
					cout<<"-------------------------"<<endl;
			    	cout<<"It will be closed 5 seconds later....."<<endl;
				}break;
            case 4:
				{
					char n1[50],n2[50];
					cout<<"Please enter the position now you are :"<<endl;
					cin>>n1;
					cout<<"Please enter the position you want to go :"<<endl;
					cin>>n2;
					GG.SP(n1,n2);
					cout<<"-------------------------"<<endl;
					cout<<"It will be closed 5 seconds later....."<<endl;
				}break;
		 }
		if(xx==5)cout<<"It will be closed 5 seconds later....."<<endl;
	    _sleep(10000);
	}while(xx!=5);
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -