資源簡介
問題描述:對(duì)中國地圖進(jìn)行著色,兩個(gè)共同邊界的省份染不同的顏色,當(dāng)可以選擇7、6、5、4種不同的顏色的情況下,由程序自動(dòng)進(jìn)行處理,給出具體的染色方案。
基本要求:
(1)建立以省為節(jié)點(diǎn),以是否相鄰為邊的一個(gè)無向圖;
(2)從顏色模板中選取一個(gè)顏色賦值給每個(gè)節(jié)點(diǎn);
(3) 相鄰節(jié)點(diǎn)顏色不能相同;
測試數(shù)據(jù):學(xué)生可以自己選取顏色模板做為測試數(shù)據(jù);分別需要測試7、6、5、4種不同的顏色。
提高要求:當(dāng)用4種顏色染色時(shí),給出不同的染色方案,著色是彩色圖

代碼片段和文件信息
//?ChinaMap.cpp?:?Defines?the?class?behaviors?for?the?application.
//
#include?“stdafx.h“
#include?“ChinaMap.h“
#include?“ChinaMapDlg.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CChinaMapApp
BEGIN_MESSAGE_MAP(CChinaMapApp?CWinApp)
//{{AFX_MSG_MAP(CChinaMapApp)
//?NOTE?-?the?ClassWizard?will?add?and?remove?mapping?macros?here.
//????DO?NOT?EDIT?what?you?see?in?these?blocks?of?generated?code!
//}}AFX_MSG
ON_COMMAND(ID_HELP?CWinApp::onhelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
//?CChinaMapApp?construction
CChinaMapApp::CChinaMapApp()
{
//?TODO:?add?construction?code?here
//?Place?all?significant?initialization?in?InitInstance
}
/////////////////////////////////////////////////////////////////////////////
//?The?one?and?only?CChinaMapApp?object
CChinaMapApp?theApp;
/////////////////////////////////////////////////////////////////////////////
//?CChinaMapApp?initialization
BOOL?CChinaMapApp::InitInstance()
{
AfxEnableControlContainer();
//?Standard?initialization
//?If?you?are?not?using?these?features?and?wish?to?reduce?the?size
//??of?your?final?executable?you?should?remove?from?the?following
//??the?specific?initialization?routines?you?do?not?need.
#ifdef?_AFXDLL
Enable3dControls(); //?Call?this?when?using?MFC?in?a?shared?DLL
#else
Enable3dControlsStatic(); //?Call?this?when?linking?to?MFC?statically
#endif
CChinaMapDlg?dlg;
m_pMainWnd?=?&dlg;
int?nResponse?=?dlg.DoModal();
if?(nResponse?==?IDOK)
{
//?TODO:?Place?code?here?to?handle?when?the?dialog?is
//??dismissed?with?OK
}
else?if?(nResponse?==?IDCANCEL)
{
//?TODO:?Place?code?here?to?handle?when?the?dialog?is
//??dismissed?with?Cancel
}
//?Since?the?dialog?has?been?closed?return?FALSE?so?that?we?exit?the
//??application?rather?than?start?the?application‘s?message?pump.
return?FALSE;
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????1178848??2012-03-17?19:59??課設(shè)\ChinaMap\ChinaMap.aps
?????文件?????151422??2012-03-17?19:59??課設(shè)\ChinaMap\res\cc.ico
?????文件???????1078??2012-03-17?19:59??課設(shè)\ChinaMap\res\ChinaMap.ico
?????文件????????400??2012-03-17?19:59??課設(shè)\ChinaMap\res\ChinaMap.rc2
?????文件????????766??2012-03-17?19:59??課設(shè)\ChinaMap\res\icon1.ico
?????文件?????990054??2012-03-17?19:59??課設(shè)\ChinaMap\res\中國地圖.bmp
?????文件????5538816??2012-03-17?19:59??課設(shè)\ChinaMap\Debug\ChinaMap.bsc
?????文件?????240960??2012-03-17?19:59??課設(shè)\ChinaMap\Debug\ChinaMap.ilk
?????文件??????12930??2012-03-17?19:59??課設(shè)\ChinaMap\Debug\ChinaMap.obj
?????文件?????410624??2012-03-17?19:59??課設(shè)\ChinaMap\Debug\ChinaMap.pdb
?????文件??????????0??2012-03-17?19:59??課設(shè)\ChinaMap\Debug\ChinaMap.sbr
?????文件??????????0??2012-03-17?19:59??課設(shè)\ChinaMap\Debug\ChinaMapDlg.sbr
?????文件??????10760??2012-03-17?19:59??課設(shè)\ChinaMap\Debug\ColorDlg.obj
?????文件??????????0??2012-03-17?19:59??課設(shè)\ChinaMap\Debug\ColorDlg.sbr
?????文件?????105507??2012-03-17?19:59??課設(shè)\ChinaMap\Debug\StdAfx.obj
?????文件????1175646??2012-03-17?19:59??課設(shè)\ChinaMap\Debug\ChinaMap.exe
?????文件?????263168??2012-03-17?19:59??課設(shè)\ChinaMap\Debug\vc60.idb
?????文件?????462848??2012-03-17?19:59??課設(shè)\ChinaMap\Debug\vc60.pdb
?????文件?????990054??2012-03-17?19:59??課設(shè)\ChinaMap\Debug\中國地圖.bmp
?????文件??????41299??2012-03-17?19:59??課設(shè)\ChinaMap\Debug\ChinaMapDlg.obj
?????文件??????14340??2012-03-17?19:59??課設(shè)\ChinaMap\Debug\color4.txt
?????文件??????14340??2012-03-17?19:59??課設(shè)\ChinaMap\Debug\color5.txt
?????文件??????14340??2012-03-17?19:59??課設(shè)\ChinaMap\Debug\color6.txt
?????文件??????14340??2012-03-17?19:59??課設(shè)\ChinaMap\Debug\color7.txt
?????文件????7104144??2012-03-17?19:59??課設(shè)\ChinaMap\Debug\ChinaMap.pch
?????文件????1144840??2012-03-17?19:59??課設(shè)\ChinaMap\Debug\ChinaMap.res
?????文件????1374935??2012-03-17?19:59??課設(shè)\ChinaMap\Debug\StdAfx.sbr
?????文件???????1247??2012-03-17?19:59??課設(shè)\ChinaMap\ChinaMap.clw
?????文件???????2094??2012-03-17?19:59??課設(shè)\ChinaMap\ChinaMap.cpp
?????文件???????1346??2012-03-17?19:59??課設(shè)\ChinaMap\ChinaMap.h
............此處省略39個(gè)文件信息
- 上一篇:jeecms開發(fā)文檔
- 下一篇:.rar
評(píng)論
共有 條評(píng)論