diff --git a/Skewary/Cal/.vs/Cal/v15/.suo b/Skewary/Cal/.vs/Cal/v15/.suo new file mode 100644 index 00000000..273765ee Binary files /dev/null and b/Skewary/Cal/.vs/Cal/v15/.suo differ diff --git a/Skewary/Cal/.vs/Cal/v15/Browse.VC.db b/Skewary/Cal/.vs/Cal/v15/Browse.VC.db new file mode 100644 index 00000000..07a45240 Binary files /dev/null and b/Skewary/Cal/.vs/Cal/v15/Browse.VC.db differ diff --git a/Skewary/Cal/.vs/Cal/v15/Solution.VC.db b/Skewary/Cal/.vs/Cal/v15/Solution.VC.db new file mode 100644 index 00000000..9c587957 Binary files /dev/null and b/Skewary/Cal/.vs/Cal/v15/Solution.VC.db differ diff --git a/Skewary/Cal/.vs/Cal/v15/Solution.VC.db-shm b/Skewary/Cal/.vs/Cal/v15/Solution.VC.db-shm new file mode 100644 index 00000000..c5adaba5 Binary files /dev/null and b/Skewary/Cal/.vs/Cal/v15/Solution.VC.db-shm differ diff --git a/Skewary/Cal/.vs/Cal/v15/Solution.VC.db-wal b/Skewary/Cal/.vs/Cal/v15/Solution.VC.db-wal new file mode 100644 index 00000000..efa9307c Binary files /dev/null and b/Skewary/Cal/.vs/Cal/v15/Solution.VC.db-wal differ diff --git a/Skewary/Cal/.vs/Cal/v15/ipch/45badc0ae221ebc3.ipch b/Skewary/Cal/.vs/Cal/v15/ipch/45badc0ae221ebc3.ipch new file mode 100644 index 00000000..a1d09bf6 Binary files /dev/null and b/Skewary/Cal/.vs/Cal/v15/ipch/45badc0ae221ebc3.ipch differ diff --git a/Skewary/Cal/.vs/Cal/v15/ipch/c1333376e569f0f8.ipch b/Skewary/Cal/.vs/Cal/v15/ipch/c1333376e569f0f8.ipch new file mode 100644 index 00000000..4980633b Binary files /dev/null and b/Skewary/Cal/.vs/Cal/v15/ipch/c1333376e569f0f8.ipch differ diff --git a/Skewary/Cal/Cal.sln b/Skewary/Cal/Cal.sln new file mode 100644 index 00000000..ddf38da8 --- /dev/null +++ b/Skewary/Cal/Cal.sln @@ -0,0 +1,41 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.779 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ConsoleApplication1", "ConsoleApplication1\ConsoleApplication1.vcxproj", "{31B0A1BB-1F71-4FBA-9500-BDF112C504AA}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "caltest", "caltest\caltest.vcxproj", "{6B1898DB-6824-44D6-A56D-2DF4FF671ECB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {31B0A1BB-1F71-4FBA-9500-BDF112C504AA}.Debug|x64.ActiveCfg = Debug|x64 + {31B0A1BB-1F71-4FBA-9500-BDF112C504AA}.Debug|x64.Build.0 = Debug|x64 + {31B0A1BB-1F71-4FBA-9500-BDF112C504AA}.Debug|x86.ActiveCfg = Debug|Win32 + {31B0A1BB-1F71-4FBA-9500-BDF112C504AA}.Debug|x86.Build.0 = Debug|Win32 + {31B0A1BB-1F71-4FBA-9500-BDF112C504AA}.Release|x64.ActiveCfg = Release|x64 + {31B0A1BB-1F71-4FBA-9500-BDF112C504AA}.Release|x64.Build.0 = Release|x64 + {31B0A1BB-1F71-4FBA-9500-BDF112C504AA}.Release|x86.ActiveCfg = Release|Win32 + {31B0A1BB-1F71-4FBA-9500-BDF112C504AA}.Release|x86.Build.0 = Release|Win32 + {6B1898DB-6824-44D6-A56D-2DF4FF671ECB}.Debug|x64.ActiveCfg = Debug|x64 + {6B1898DB-6824-44D6-A56D-2DF4FF671ECB}.Debug|x64.Build.0 = Debug|x64 + {6B1898DB-6824-44D6-A56D-2DF4FF671ECB}.Debug|x86.ActiveCfg = Debug|Win32 + {6B1898DB-6824-44D6-A56D-2DF4FF671ECB}.Debug|x86.Build.0 = Debug|Win32 + {6B1898DB-6824-44D6-A56D-2DF4FF671ECB}.Release|x64.ActiveCfg = Release|x64 + {6B1898DB-6824-44D6-A56D-2DF4FF671ECB}.Release|x64.Build.0 = Release|x64 + {6B1898DB-6824-44D6-A56D-2DF4FF671ECB}.Release|x86.ActiveCfg = Release|Win32 + {6B1898DB-6824-44D6-A56D-2DF4FF671ECB}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {DC9A7168-5214-466A-A3D7-6461E5F72EA1} + EndGlobalSection +EndGlobal diff --git a/Skewary/Cal/ConsoleApplication1/Calculator.h b/Skewary/Cal/ConsoleApplication1/Calculator.h new file mode 100644 index 00000000..30a07183 --- /dev/null +++ b/Skewary/Cal/ConsoleApplication1/Calculator.h @@ -0,0 +1,18 @@ +#pragma once +#include "pch.h" +#include +#include +#include +#include "stdlib.h" +#include +#include +using namespace std; + +class Calculator { +private: + string op[4] = { "+", "-", "*", "/" }; +public: + Calculator(); + string MakeFormula(); + string Solve(string formula); +}; diff --git a/Skewary/Cal/ConsoleApplication1/ConsoleApplication1.cpp b/Skewary/Cal/ConsoleApplication1/ConsoleApplication1.cpp new file mode 100644 index 00000000..029488bd --- /dev/null +++ b/Skewary/Cal/ConsoleApplication1/ConsoleApplication1.cpp @@ -0,0 +1,118 @@ + + +#include "pch.h" +#include +#include +#include +#include "stdlib.h" +#include +#include +#include "Calculator.h" + +#define random(a,b) (rand()%(b-a+1)+a) + +using namespace std; + +Calculator::Calculator() {} + +string Calculator::MakeFormula() { + string formula = ""; + srand((unsigned int)time(NULL)); + int count = random(1, 3); + int start = 0; + int number1 = random(1, 100); + formula += to_string(number1); + while (start <= count) { + int operation = random(0, 3); + int number2 = random(1, 100); + formula += op[operation] + to_string(number2); + start++; + } + return formula; +}; + +string Calculator::Solve(string formula) { + vector* tempStack = new vector(); + stack* operatorStack = new stack(); + int len = formula.length(); + int k = 0; + for (int j = -1; j < len - 1; j++) { + char formulaChar = formula[j + 1]; + if (j == len - 2 || formulaChar == '+' || formulaChar == '-' || + formulaChar == '*' || formulaChar == '/') { + if (j == len - 2) { + tempStack->push_back(formula.substr(k));//last number + } + else { + if (k <= j) { + tempStack->push_back(formula.substr(k, j + 1)); + } + if (operatorStack->empty()) { + operatorStack->push(formulaChar); + } + else { + char stackChar = operatorStack->top(); + if ((stackChar == '+' || stackChar == '-') + && (formulaChar == '*' || formulaChar == '/')) { + operatorStack->push(formulaChar); + } + else { + tempStack->push_back(string(1, stackChar)); + operatorStack->pop(); + operatorStack->push(formulaChar); + } + } + } + k = j + 2; + } + } + while (!operatorStack->empty()) { + tempStack->push_back(string(1, operatorStack->top())); + operatorStack->pop(); + } + stack* calcStack = new stack(); + for (int i = 0; i < tempStack->size(); i++) { + string peekChar = tempStack->at(i); + if (peekChar != "+" && peekChar != "-" + && peekChar != "/" && peekChar != "*") { + calcStack->push(peekChar); + } + else { + int a1 = 0; + int b1 = 0; + if (!calcStack->empty()) { + b1 = stoi(calcStack->top()); + calcStack->pop(); + } + if (!calcStack->empty()) { + a1 = stoi(calcStack->top()); + calcStack->pop(); + } + if (peekChar == "+") { + calcStack->push(to_string(a1 + b1)); + } + else if (peekChar == "-") { + calcStack->push(to_string(a1 - b1)); + } + else if (peekChar == "*") { + calcStack->push(to_string(a1 * b1)); + } + else if (peekChar == "/") { + calcStack->push(to_string(a1 / b1)); + } + } + } + return formula + "=" + calcStack->top(); +} + +int main() +{ + Calculator* calc = new Calculator(); + string question = calc->MakeFormula(); + cout << question << endl; + string ret = calc->Solve("11+22"); + cout << ret << endl; + getchar(); +} + + diff --git a/Skewary/Cal/ConsoleApplication1/ConsoleApplication1.vcxproj b/Skewary/Cal/ConsoleApplication1/ConsoleApplication1.vcxproj new file mode 100644 index 00000000..a4e9f4d9 --- /dev/null +++ b/Skewary/Cal/ConsoleApplication1/ConsoleApplication1.vcxproj @@ -0,0 +1,169 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {31B0A1BB-1F71-4FBA-9500-BDF112C504AA} + Win32Proj + ConsoleApplication1 + 10.0.17763.0 + + + + Application + true + v141 + Unicode + + + Application + false + v141 + true + Unicode + + + Application + true + v141 + Unicode + + + Application + false + v141 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + Use + Level3 + Disabled + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h + + + Console + true + + + + + Use + Level3 + Disabled + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h + + + Console + true + + + + + Use + Level3 + MaxSpeed + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h + + + Console + true + true + true + + + + + Use + Level3 + MaxSpeed + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + pch.h + + + Console + true + true + true + + + + + + + + + + Create + Create + Create + Create + + + + + + \ No newline at end of file diff --git a/Skewary/Cal/ConsoleApplication1/ConsoleApplication1.vcxproj.filters b/Skewary/Cal/ConsoleApplication1/ConsoleApplication1.vcxproj.filters new file mode 100644 index 00000000..d2e9aa4f --- /dev/null +++ b/Skewary/Cal/ConsoleApplication1/ConsoleApplication1.vcxproj.filters @@ -0,0 +1,33 @@ + + + + + {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;ipp;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 diff --git a/Skewary/Cal/ConsoleApplication1/ConsoleApplication1.vcxproj.user b/Skewary/Cal/ConsoleApplication1/ConsoleApplication1.vcxproj.user new file mode 100644 index 00000000..be250787 --- /dev/null +++ b/Skewary/Cal/ConsoleApplication1/ConsoleApplication1.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Skewary/Cal/ConsoleApplication1/Debug/ConsoleA.31B0A1BB.tlog/CL.command.1.tlog b/Skewary/Cal/ConsoleApplication1/Debug/ConsoleA.31B0A1BB.tlog/CL.command.1.tlog new file mode 100644 index 00000000..04647e51 Binary files /dev/null and b/Skewary/Cal/ConsoleApplication1/Debug/ConsoleA.31B0A1BB.tlog/CL.command.1.tlog differ diff --git a/Skewary/Cal/ConsoleApplication1/Debug/ConsoleA.31B0A1BB.tlog/CL.read.1.tlog b/Skewary/Cal/ConsoleApplication1/Debug/ConsoleA.31B0A1BB.tlog/CL.read.1.tlog new file mode 100644 index 00000000..9485e671 Binary files /dev/null and b/Skewary/Cal/ConsoleApplication1/Debug/ConsoleA.31B0A1BB.tlog/CL.read.1.tlog differ diff --git a/Skewary/Cal/ConsoleApplication1/Debug/ConsoleA.31B0A1BB.tlog/CL.write.1.tlog b/Skewary/Cal/ConsoleApplication1/Debug/ConsoleA.31B0A1BB.tlog/CL.write.1.tlog new file mode 100644 index 00000000..5057ab9c Binary files /dev/null and b/Skewary/Cal/ConsoleApplication1/Debug/ConsoleA.31B0A1BB.tlog/CL.write.1.tlog differ diff --git a/Skewary/Cal/ConsoleApplication1/Debug/ConsoleA.31B0A1BB.tlog/ConsoleApplication1.lastbuildstate b/Skewary/Cal/ConsoleApplication1/Debug/ConsoleA.31B0A1BB.tlog/ConsoleApplication1.lastbuildstate new file mode 100644 index 00000000..2bf8da6b --- /dev/null +++ b/Skewary/Cal/ConsoleApplication1/Debug/ConsoleA.31B0A1BB.tlog/ConsoleApplication1.lastbuildstate @@ -0,0 +1,2 @@ +#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0 +Debug|Win32|C:\Users\叶志翔\Desktop\Calculator\Skewary\Cal\| diff --git a/Skewary/Cal/ConsoleApplication1/Debug/ConsoleA.31B0A1BB.tlog/link.command.1.tlog b/Skewary/Cal/ConsoleApplication1/Debug/ConsoleA.31B0A1BB.tlog/link.command.1.tlog new file mode 100644 index 00000000..c65fc6e7 Binary files /dev/null and b/Skewary/Cal/ConsoleApplication1/Debug/ConsoleA.31B0A1BB.tlog/link.command.1.tlog differ diff --git a/Skewary/Cal/ConsoleApplication1/Debug/ConsoleA.31B0A1BB.tlog/link.read.1.tlog b/Skewary/Cal/ConsoleApplication1/Debug/ConsoleA.31B0A1BB.tlog/link.read.1.tlog new file mode 100644 index 00000000..447dabfd Binary files /dev/null and b/Skewary/Cal/ConsoleApplication1/Debug/ConsoleA.31B0A1BB.tlog/link.read.1.tlog differ diff --git a/Skewary/Cal/ConsoleApplication1/Debug/ConsoleA.31B0A1BB.tlog/link.write.1.tlog b/Skewary/Cal/ConsoleApplication1/Debug/ConsoleA.31B0A1BB.tlog/link.write.1.tlog new file mode 100644 index 00000000..8c15da75 Binary files /dev/null and b/Skewary/Cal/ConsoleApplication1/Debug/ConsoleA.31B0A1BB.tlog/link.write.1.tlog differ diff --git a/Skewary/Cal/ConsoleApplication1/Debug/ConsoleApplication1.log b/Skewary/Cal/ConsoleApplication1/Debug/ConsoleApplication1.log new file mode 100644 index 00000000..191554ef --- /dev/null +++ b/Skewary/Cal/ConsoleApplication1/Debug/ConsoleApplication1.log @@ -0,0 +1,3 @@ + ConsoleApplication1.cpp +c:\users\叶志翔\desktop\calculator\skewary\cal\consoleapplication1\consoleapplication1.cpp(74): warning C4018: “<”: 有符号/无符号不匹配 + ConsoleApplication1.vcxproj -> C:\Users\叶志翔\Desktop\Calculator\Skewary\Cal\Debug\ConsoleApplication1.exe diff --git a/Skewary/Cal/ConsoleApplication1/Debug/vc141.idb b/Skewary/Cal/ConsoleApplication1/Debug/vc141.idb new file mode 100644 index 00000000..7ac5684e Binary files /dev/null and b/Skewary/Cal/ConsoleApplication1/Debug/vc141.idb differ diff --git a/Skewary/Cal/ConsoleApplication1/Debug/vc141.pdb b/Skewary/Cal/ConsoleApplication1/Debug/vc141.pdb new file mode 100644 index 00000000..a34d2ab7 Binary files /dev/null and b/Skewary/Cal/ConsoleApplication1/Debug/vc141.pdb differ diff --git a/Skewary/Cal/ConsoleApplication1/pch.cpp b/Skewary/Cal/ConsoleApplication1/pch.cpp new file mode 100644 index 00000000..8eb50d04 --- /dev/null +++ b/Skewary/Cal/ConsoleApplication1/pch.cpp @@ -0,0 +1,5 @@ +// pch.cpp: 与预编译标头对应的源文件;编译成功所必需的 + +#include "pch.h" + +// 一般情况下,忽略此文件,但如果你使用的是预编译标头,请保留它。 diff --git a/Skewary/Cal/ConsoleApplication1/pch.h b/Skewary/Cal/ConsoleApplication1/pch.h new file mode 100644 index 00000000..69bf59d2 --- /dev/null +++ b/Skewary/Cal/ConsoleApplication1/pch.h @@ -0,0 +1,14 @@ +// 入门提示: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 + +#ifndef PCH_H +#define PCH_H + +// TODO: 添加要在此处预编译的标头 + +#endif //PCH_H diff --git a/Skewary/Cal/Debug/ConsoleApplication1.ilk b/Skewary/Cal/Debug/ConsoleApplication1.ilk new file mode 100644 index 00000000..96c4a5ec Binary files /dev/null and b/Skewary/Cal/Debug/ConsoleApplication1.ilk differ diff --git a/Skewary/Cal/Debug/ConsoleApplication1.pdb b/Skewary/Cal/Debug/ConsoleApplication1.pdb new file mode 100644 index 00000000..11f404ea Binary files /dev/null and b/Skewary/Cal/Debug/ConsoleApplication1.pdb differ diff --git a/Skewary/Cal/Debug/caltest.exp b/Skewary/Cal/Debug/caltest.exp new file mode 100644 index 00000000..591d3aba Binary files /dev/null and b/Skewary/Cal/Debug/caltest.exp differ diff --git a/Skewary/Cal/Debug/caltest.ilk b/Skewary/Cal/Debug/caltest.ilk new file mode 100644 index 00000000..c69c601b Binary files /dev/null and b/Skewary/Cal/Debug/caltest.ilk differ diff --git a/Skewary/Cal/Debug/caltest.pdb b/Skewary/Cal/Debug/caltest.pdb new file mode 100644 index 00000000..0f953f3b Binary files /dev/null and b/Skewary/Cal/Debug/caltest.pdb differ diff --git a/Skewary/Cal/caltest/Debug/caltest.log b/Skewary/Cal/caltest/Debug/caltest.log new file mode 100644 index 00000000..6024d21b --- /dev/null +++ b/Skewary/Cal/caltest/Debug/caltest.log @@ -0,0 +1 @@ + caltest.vcxproj -> C:\Users\叶志翔\Desktop\Calculator\Skewary\Cal\Debug\caltest.dll diff --git a/Skewary/Cal/caltest/Debug/caltest.tlog/CL.command.1.tlog b/Skewary/Cal/caltest/Debug/caltest.tlog/CL.command.1.tlog new file mode 100644 index 00000000..fbdd5b24 Binary files /dev/null and b/Skewary/Cal/caltest/Debug/caltest.tlog/CL.command.1.tlog differ diff --git a/Skewary/Cal/caltest/Debug/caltest.tlog/CL.read.1.tlog b/Skewary/Cal/caltest/Debug/caltest.tlog/CL.read.1.tlog new file mode 100644 index 00000000..eb55006b Binary files /dev/null and b/Skewary/Cal/caltest/Debug/caltest.tlog/CL.read.1.tlog differ diff --git a/Skewary/Cal/caltest/Debug/caltest.tlog/CL.write.1.tlog b/Skewary/Cal/caltest/Debug/caltest.tlog/CL.write.1.tlog new file mode 100644 index 00000000..067f3c2e Binary files /dev/null and b/Skewary/Cal/caltest/Debug/caltest.tlog/CL.write.1.tlog differ diff --git a/Skewary/Cal/caltest/Debug/caltest.tlog/caltest.lastbuildstate b/Skewary/Cal/caltest/Debug/caltest.tlog/caltest.lastbuildstate new file mode 100644 index 00000000..2bf8da6b --- /dev/null +++ b/Skewary/Cal/caltest/Debug/caltest.tlog/caltest.lastbuildstate @@ -0,0 +1,2 @@ +#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0 +Debug|Win32|C:\Users\叶志翔\Desktop\Calculator\Skewary\Cal\| diff --git a/Skewary/Cal/caltest/Debug/caltest.tlog/caltest.write.1u.tlog b/Skewary/Cal/caltest/Debug/caltest.tlog/caltest.write.1u.tlog new file mode 100644 index 00000000..5d7fec90 Binary files /dev/null and b/Skewary/Cal/caltest/Debug/caltest.tlog/caltest.write.1u.tlog differ diff --git a/Skewary/Cal/caltest/Debug/caltest.tlog/link.command.1.tlog b/Skewary/Cal/caltest/Debug/caltest.tlog/link.command.1.tlog new file mode 100644 index 00000000..94cc1383 Binary files /dev/null and b/Skewary/Cal/caltest/Debug/caltest.tlog/link.command.1.tlog differ diff --git a/Skewary/Cal/caltest/Debug/caltest.tlog/link.read.1.tlog b/Skewary/Cal/caltest/Debug/caltest.tlog/link.read.1.tlog new file mode 100644 index 00000000..01647502 Binary files /dev/null and b/Skewary/Cal/caltest/Debug/caltest.tlog/link.read.1.tlog differ diff --git a/Skewary/Cal/caltest/Debug/caltest.tlog/link.write.1.tlog b/Skewary/Cal/caltest/Debug/caltest.tlog/link.write.1.tlog new file mode 100644 index 00000000..51a3d300 Binary files /dev/null and b/Skewary/Cal/caltest/Debug/caltest.tlog/link.write.1.tlog differ diff --git a/Skewary/Cal/caltest/Debug/vc141.idb b/Skewary/Cal/caltest/Debug/vc141.idb new file mode 100644 index 00000000..9dc6ae47 Binary files /dev/null and b/Skewary/Cal/caltest/Debug/vc141.idb differ diff --git a/Skewary/Cal/caltest/Debug/vc141.pdb b/Skewary/Cal/caltest/Debug/vc141.pdb new file mode 100644 index 00000000..977ef6ec Binary files /dev/null and b/Skewary/Cal/caltest/Debug/vc141.pdb differ diff --git a/Skewary/Cal/caltest/caltest.vcxproj b/Skewary/Cal/caltest/caltest.vcxproj new file mode 100644 index 00000000..8b77c0a7 --- /dev/null +++ b/Skewary/Cal/caltest/caltest.vcxproj @@ -0,0 +1,176 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {6B1898DB-6824-44D6-A56D-2DF4FF671ECB} + Win32Proj + caltest + 10.0.17763.0 + NativeUnitTestProject + + + + DynamicLibrary + true + v141 + Unicode + false + + + DynamicLibrary + false + v141 + true + Unicode + false + + + DynamicLibrary + true + v141 + Unicode + false + + + DynamicLibrary + false + v141 + true + Unicode + false + + + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + + Use + Level3 + Disabled + $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;%(PreprocessorDefinitions) + true + + + Windows + $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories) + ..\ConsoleApplication1\Debug\ConsoleApplication1.obj;..\ConsoleApplication1\Debug\pch.obj;%(AdditionalDependencies) + + + + + Use + Level3 + Disabled + $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories) + _DEBUG;%(PreprocessorDefinitions) + true + + + Windows + $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories) + + + + + Level3 + Use + MaxSpeed + true + true + $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;%(PreprocessorDefinitions) + true + + + Windows + true + true + $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories) + + + + + Level3 + Use + MaxSpeed + true + true + $(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories) + NDEBUG;%(PreprocessorDefinitions) + true + + + Windows + true + true + $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories) + + + + + + + + + Create + Create + Create + Create + + + + + + {31b0a1bb-1f71-4fba-9500-bdf112c504aa} + + + + + + \ No newline at end of file diff --git a/Skewary/Cal/caltest/caltest.vcxproj.filters b/Skewary/Cal/caltest/caltest.vcxproj.filters new file mode 100644 index 00000000..a3bc7845 --- /dev/null +++ b/Skewary/Cal/caltest/caltest.vcxproj.filters @@ -0,0 +1,33 @@ + + + + + {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;ipp;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 diff --git a/Skewary/Cal/caltest/caltest.vcxproj.user b/Skewary/Cal/caltest/caltest.vcxproj.user new file mode 100644 index 00000000..be250787 --- /dev/null +++ b/Skewary/Cal/caltest/caltest.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Skewary/Cal/caltest/stdafx.cpp b/Skewary/Cal/caltest/stdafx.cpp new file mode 100644 index 00000000..b6dbca91 --- /dev/null +++ b/Skewary/Cal/caltest/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : ֻ׼ļԴļ +// caltest.pch ΪԤͷ +// stdafx.obj ԤϢ + +#include "stdafx.h" + +// TODO: STDAFX.H κĸͷļ +//ڴļ diff --git a/Skewary/Cal/caltest/stdafx.h b/Skewary/Cal/caltest/stdafx.h new file mode 100644 index 00000000..3a1e49d2 --- /dev/null +++ b/Skewary/Cal/caltest/stdafx.h @@ -0,0 +1,13 @@ +// stdafx.h : ׼ϵͳļİļ +// Ǿʹõĵ +// ضĿİļ +// + +#pragma once + +#include "targetver.h" + +// CppUnitTest ͷļ +#include "CppUnitTest.h" + +// TODO: ڴ˴óҪͷļ diff --git a/Skewary/Cal/caltest/targetver.h b/Skewary/Cal/caltest/targetver.h new file mode 100644 index 00000000..416cebf8 --- /dev/null +++ b/Skewary/Cal/caltest/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// SDKDDKVer.h õ߰汾 Windows ƽ̨ + +// ҪΪǰ Windows ƽ̨Ӧó WinSDKVer.h +// _WIN32_WINNT ΪҪֵ֧ƽ̨Ȼٰ SDKDDKVer.h + +#include diff --git a/Skewary/Cal/caltest/unittest1.cpp b/Skewary/Cal/caltest/unittest1.cpp new file mode 100644 index 00000000..9908aa67 --- /dev/null +++ b/Skewary/Cal/caltest/unittest1.cpp @@ -0,0 +1,21 @@ +#include "stdafx.h" +#include "CppUnitTest.h" +#include "../ConsoleApplication1/calculator.h" +using namespace Microsoft::VisualStudio::CppUnitTestFramework; + +namespace caltest +{ + TEST_CLASS(UnitTest1) + { + public: + + TEST_METHOD(TestMethod1) + { + // TODO: ڴԴ + Calculator* calc = new Calculator(); + string ret = calc->Solve("2*3+4*5"); + Assert::AreEqual(ret, (string)"2*3+4*5=26"); + } + + }; +} \ No newline at end of file