From ea52524df4d019d3567c48a1e89c5862b97a8cea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=98=A5=E5=B1=B1?= <1760264627@qq.com> Date: Mon, 7 Dec 2020 17:00:13 +0800 Subject: [PATCH] 11 --- jia/jia/jia.cpp | 23 ++++++++++ jia/jia/jia.h | 6 +++ jia/jia/jia.vcxproj | 85 +++++++++++++++++++++++++++++++++++++ jia/jia/jia.vcxproj.filters | 30 +++++++++++++ 4 files changed, 144 insertions(+) create mode 100644 jia/jia/jia.cpp create mode 100644 jia/jia/jia.h create mode 100644 jia/jia/jia.vcxproj create mode 100644 jia/jia/jia.vcxproj.filters diff --git a/jia/jia/jia.cpp b/jia/jia/jia.cpp new file mode 100644 index 0000000..b87e6e4 --- /dev/null +++ b/jia/jia/jia.cpp @@ -0,0 +1,23 @@ +#include "jia.h" +#include +bool Add(int a, int b, int *c) +{ + if (a>0&&b>0&&a > INT_MAX - b ||a<0&&b<0&& a < INT_MIN - b) + { + + return false; + } + else + { + *c = a + b; + return true; + + } + +} +int add(int a, int b) +{ + return a + b; +} + + diff --git a/jia/jia/jia.h b/jia/jia/jia.h new file mode 100644 index 0000000..a4056c5 --- /dev/null +++ b/jia/jia/jia.h @@ -0,0 +1,6 @@ +#ifndef ADD_H +#define ADD_H + +bool Add(int a, int b, int *c); +int add(int a, int b); +#endif \ No newline at end of file diff --git a/jia/jia/jia.vcxproj b/jia/jia/jia.vcxproj new file mode 100644 index 0000000..769082f --- /dev/null +++ b/jia/jia/jia.vcxproj @@ -0,0 +1,85 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {FC133E06-9EE0-4441-A557-12C5BFB381DB} + Win32Proj + jia + + + + StaticLibrary + true + v120 + Unicode + + + StaticLibrary + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + + + Windows + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + + + Windows + true + true + true + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jia/jia/jia.vcxproj.filters b/jia/jia/jia.vcxproj.filters new file mode 100644 index 0000000..51fb8f6 --- /dev/null +++ b/jia/jia/jia.vcxproj.filters @@ -0,0 +1,30 @@ + + + + + {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