maxmin.cpp

来自「精通matlab7.0及与其他语言的混合编程」· C++ 代码 · 共 51 行

CPP
51
字号
// MaxMin.cpp : Defines the initialization routines for the DLL.
//

#include "stdafx.h"
#include "MaxMin.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMaxMinApp

BEGIN_MESSAGE_MAP(CMaxMinApp, CWinApp)
	//{{AFX_MSG_MAP(CMaxMinApp)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMaxMinApp construction

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

/////////////////////////////////////////////////////////////////////////////
// The one and only CMaxMinApp object

CMaxMinApp theApp;

extern "C" __declspec(dllexport) int Min1(int x,int y,int z) 
{ 
if ((x<=y) & (x<=z)) return x; 
else if ((y<=x) & (y<=z)) return y; 
else return z; /*找出x,y,z中的最小整数*/ 
} 
 
extern "C" __declspec(dllexport) int Max1(int x,int y,int z) 
{ 
if ((x>=y) & (x>=z)) return x; 
else if ((y>=x) & (y>=z)) return y; 
else return z; /*找出x,y,z中的最大整数*/ 
} 

⌨️ 快捷键说明

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