diff --git a/chen/Source.def b/chen/Source.def new file mode 100644 index 0000000..2808b55 --- /dev/null +++ b/chen/Source.def @@ -0,0 +1,4 @@ +LIBRARY CHEN +EXPORTS +mul +chen diff --git a/chen/chen.cpp b/chen/chen.cpp new file mode 100644 index 0000000..fd50673 --- /dev/null +++ b/chen/chen.cpp @@ -0,0 +1,22 @@ +#include "chen.h" +#include +bool chen(int a, int b, int *e) +{ + if (a>0 && b>0 && a > INT_MAX / b || a<0 && b<0 && a < INT_MAX / b || a>0 && b<0 && a < INT_MIN / b || a<0 && b>0 && a > INT_MIN /b ) + { + + return false; + } + else + { + *e = a * b; + return true; + + } + +} +int mul(int a, int b) +{ + + return a * b; +} diff --git a/chen/chen.h b/chen/chen.h new file mode 100644 index 0000000..b3c7b71 --- /dev/null +++ b/chen/chen.h @@ -0,0 +1,8 @@ +#ifndef MUL_H +#define MUL_H + + +int mul(int a, int b); + bool chen(int a, int b, int *e); + +#endif \ No newline at end of file diff --git a/chen/chen.vcxproj b/chen/chen.vcxproj new file mode 100644 index 0000000..21d6dff --- /dev/null +++ b/chen/chen.vcxproj @@ -0,0 +1,92 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {D3E01979-7A19-4FCB-B43B-59E1F322215F} + Win32Proj + chen + + + + DynamicLibrary + true + v120 + Unicode + + + DynamicLibrary + false + v120 + true + Unicode + + + + + + + + + + + + + true + + + false + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;_USRDLL;CHEN_EXPORTS;_DLLAPI;%(PreprocessorDefinitions) + + + Windows + true + Source.def + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;_USRDLL;CHEN_EXPORTS;%(PreprocessorDefinitions) + + + Windows + true + true + true + Source.def + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/chen/chen.vcxproj.filters b/chen/chen.vcxproj.filters new file mode 100644 index 0000000..6c2e95a --- /dev/null +++ b/chen/chen.vcxproj.filters @@ -0,0 +1,32 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + 头文件 + + + + + 源文件 + + + + + 源文件 + + + \ No newline at end of file