冒泡排序过程演示程序


创建一个基于对话框的应用程序,在客户区显示待排序的元素,点击“开始排序”按钮,开始演示每一轮各元素比较交换的过程。
资源截图
代码片段和文件信息
// Ex_MP.cpp : Defines the class behaviors for the application.
//

#include “stdafx.h“
#include “Ex_MP.h“
#include “Ex_MPDlg.h“

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CEx_MPApp

BEGIN_MESSAGE_MAP(CEx_MPApp CWinApp)
//{{AFX_MSG_MAP(CEx_MPApp)
// 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()

/////////////////////////////////////////////////////////////////////////////
// CEx_MPApp construction

CEx_MPApp::CEx_MPApp()
{
// TODO: add construction code here
// Place all significant initialization in InitInstance
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CEx_MPApp object

CEx_MPApp theApp;

/////////////////////////////////////////////////////////////////////////////
// CEx_MPApp initialization

BOOL CEx_MPApp::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

CEx_MPDlg 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;
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2012-06-14 12:37  Ex_MP
     目录           0  2012-06-14 12:37  Ex_MPDebug
     文件      106570  2004-01-01 06:23  Ex_MPDebugEx_MP.exe
     文件      219984  2004-01-01 06:23  Ex_MPDebugEx_MP.ilk
     文件       14060  2004-01-01 06:14  Ex_MPDebugEx_MP.obj
     文件     5492816  2004-01-01 04:52  Ex_MPDebugEx_MP.pch
     文件      386048  2004-01-01 06:23  Ex_MPDebugEx_MP.pdb
     文件        2608  2004-01-01 06:23  Ex_MPDebugEx_MP.res
     文件       30493  2004-01-01 06:15  Ex_MPDebugEx_MPDlg.obj
     文件      105658  2004-01-01 04:52  Ex_MPDebugStdAfx.obj
     文件      205824  2004-01-01 01:50  Ex_MPDebugvc60.idb
     文件      364544  2004-01-01 06:15  Ex_MPDebugvc60.pdb
     文件       21072  2004-01-01 01:49  Ex_MPEx_MP.aps
     文件        1232  2004-01-01 06:23  Ex_MPEx_MP.clw
     文件        2049  2004-01-01 02:02  Ex_MPEx_MP.cpp
     文件        4141  2004-01-01 02:02  Ex_MPEx_MP.dsp
     文件         518  2004-01-01 02:02  Ex_MPEx_MP.dsw
     文件        1313  2004-01-01 02:02  Ex_MPEx_MP.h
     文件       58368  2004-01-01 01:50  Ex_MPEx_MP.ncb
     文件       53760  2004-01-01 01:50  Ex_MPEx_MP.opt
     文件         690  2004-01-01 06:23  Ex_MPEx_MP.plg
     文件        5518  2004-01-01 06:23  Ex_MPEx_MP.rc
     文件        5245  2004-01-01 06:15  Ex_MPEx_MPDlg.cpp
     文件        1379  2004-01-01 06:12  Ex_MPEx_MPDlg.h
     文件        3561  2004-01-01 02:02  Ex_MPReadMe.txt
     文件         207  2004-01-01 02:02  Ex_MPStdAfx.cpp
     文件        1054  2004-01-01 02:02  Ex_MPStdAfx.h
     目录           0  2012-06-14 12:37  Ex_MP
es
     文件        1078  2004-01-01 02:02  Ex_MP
esEx_MP.ico
     文件         397  2004-01-01 02:02  Ex_MP
esEx_MP.rc2
     文件         729  2004-01-01 00:55  Ex_MP
esource.h
............此处省略0个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)