#include "math.h"
extern "C" _declspec(dllexport) int __stdcall max(int *a,int b)
{
int i, Amax;
Amax = *(a+0);
for(i=0;i<=b;i++)
{
if (*(a+i)>Amax)
Amax = *(a+i);
}
return Amax;
}
extern "C" _declspec(dllexport) int __stdcall min(int *a,int b)
{
int i, Amin;
Amin = *(a+0);
for(i=0;i<=b;i++)
{
if (*(a+i)<Amin)
Amin = *(a+i);
}
return Amin;
}
struct Point {
double x;
double y;
double z;
};
extern "C" _declspec(dllexport) double __stdcall GetLength(Point *A, Point *B)
{
double nXlen = A->x - B->x;
double nYlen = A->y - B->y;
double nZlen = A->z - B->z;
double nLength =sqrt(pow(nXlen,2) + pow(nYlen, 2) + pow(nZlen, 2));
return nLength;
}
siaswjf
- 粉丝: 4
- 资源: 36
- 1
- 2
前往页