資源簡介
使用MFC設計了一個冒泡排序算法。
1、在編輯框中輸入要排序的數字,用空格隔開
2、點擊“排序"后,排序結果便可輸出。

代碼片段和文件信息
//?Bubble_Sort_MFC.cpp?:?Defines?the?class?behaviors?for?the?application.
//
#include?“stdafx.h“
#include?“Bubble_Sort_MFC.h“
#include?“Bubble_Sort_MFCDlg.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//?CBubble_Sort_MFCApp
BEGIN_MESSAGE_MAP(CBubble_Sort_MFCApp?CWinApp)
//{{AFX_MSG_MAP(CBubble_Sort_MFCApp)
//?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()
/////////////////////////////////////////////////////////////////////////////
//?CBubble_Sort_MFCApp?construction
CBubble_Sort_MFCApp::CBubble_Sort_MFCApp()
{
//?TODO:?add?construction?code?here
//?Place?all?significant?initialization?in?InitInstance
}
/////////////////////////////////////////////////////////////////////////////
//?The?one?and?only?CBubble_Sort_MFCApp?object
CBubble_Sort_MFCApp?theApp;
/////////////////////////////////////////////////////////////////////////////
//?CBubble_Sort_MFCApp?initialization
BOOL?CBubble_Sort_MFCApp::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
CBubble_Sort_MFCDlg?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;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????36240??2014-06-12?15:57??Bubble_Sort_MFC\Bubble_Sort_MFC.aps
?????文件???????1494??2014-06-12?16:00??Bubble_Sort_MFC\Bubble_Sort_MFC.clw
?????文件???????2189??2014-06-11?20:05??Bubble_Sort_MFC\Bubble_Sort_MFC.cpp
?????文件???????4385??2014-06-12?16:03??Bubble_Sort_MFC\Bubble_Sort_MFC.dsp
?????文件????????555??2014-06-11?20:05??Bubble_Sort_MFC\Bubble_Sort_MFC.dsw
?????文件???????1423??2014-06-11?20:05??Bubble_Sort_MFC\Bubble_Sort_MFC.h
?????文件??????58368??2014-06-12?16:03??Bubble_Sort_MFC\Bubble_Sort_MFC.ncb
?????文件??????49664??2014-06-12?16:03??Bubble_Sort_MFC\Bubble_Sort_MFC.opt
?????文件???????1192??2014-06-12?16:00??Bubble_Sort_MFC\Bubble_Sort_MFC.plg
?????文件???????6119??2014-06-12?15:57??Bubble_Sort_MFC\Bubble_Sort_MFC.rc
?????文件???????6686??2014-06-12?16:00??Bubble_Sort_MFC\Bubble_Sort_MFCDlg.cpp
?????文件???????1610??2014-06-12?15:52??Bubble_Sort_MFC\Bubble_Sort_MFCDlg.h
?????文件?????118866??2014-06-12?16:00??Bubble_Sort_MFC\Debug\Bubble_Sort_MFC.exe
?????文件?????256848??2014-06-12?16:00??Bubble_Sort_MFC\Debug\Bubble_Sort_MFC.ilk
?????文件??????14755??2014-06-12?15:54??Bubble_Sort_MFC\Debug\Bubble_Sort_MFC.obj
?????文件????5498412??2014-06-11?20:17??Bubble_Sort_MFC\Debug\Bubble_Sort_MFC.pch
?????文件?????435200??2014-06-12?16:00??Bubble_Sort_MFC\Debug\Bubble_Sort_MFC.pdb
?????文件???????2936??2014-06-12?15:57??Bubble_Sort_MFC\Debug\Bubble_Sort_MFC.res
?????文件??????64040??2014-06-12?16:00??Bubble_Sort_MFC\Debug\Bubble_Sort_MFCDlg.obj
?????文件?????105674??2014-06-11?20:17??Bubble_Sort_MFC\Debug\StdAfx.obj
?????文件?????238592??2014-06-12?16:00??Bubble_Sort_MFC\Debug\vc60.idb
?????文件?????405504??2014-06-12?16:00??Bubble_Sort_MFC\Debug\vc60.pdb
?????文件???????3741??2014-06-11?20:05??Bubble_Sort_MFC\ReadMe.txt
?????文件???????1078??2014-06-11?20:05??Bubble_Sort_MFC\res\Bubble_Sort_MFC.ico
?????文件????????407??2014-06-11?20:05??Bubble_Sort_MFC\res\Bubble_Sort_MFC.rc2
?????文件????????831??2014-06-11?20:17??Bubble_Sort_MFC\resource.h
?????文件????????217??2014-06-11?20:05??Bubble_Sort_MFC\StdAfx.cpp
?????文件???????1054??2014-06-11?20:05??Bubble_Sort_MFC\StdAfx.h
?????文件?????????79??2014-06-12?16:02??Bubble_Sort_MFC\使用說明.txt
?????目錄??????????0??2014-06-12?16:00??Bubble_Sort_MFC\Debug
............此處省略5個文件信息
- 上一篇:c++數據結構實現經典背包問題
- 下一篇:MFC課程設計報告-手把手教你寫貪吃蛇
評論
共有 條評論