From a76ff02dcfd49aee33f9eb634ee054e0f364ab64 Mon Sep 17 00:00:00 2001 From: pyc-ycy <2923616405@qq.com> Date: Sat, 1 Jun 2019 13:28:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0\345\215\225\351\223\276\350\241\250.sln" | 31 ++++ .../pch.cpp" | 5 + .../pch.h" | 14 ++ ...0\345\215\225\351\223\276\350\241\250.cpp" | 59 ++++++ ...5\215\225\351\223\276\350\241\250.vcxproj" | 168 ++++++++++++++++++ ...5\351\223\276\350\241\250.vcxproj.filters" | 30 ++++ 6 files changed, 307 insertions(+) create mode 100644 "\347\256\200\345\215\225\351\223\276\350\241\250.sln" create mode 100644 "\347\256\200\345\215\225\351\223\276\350\241\250/pch.cpp" create mode 100644 "\347\256\200\345\215\225\351\223\276\350\241\250/pch.h" create mode 100644 "\347\256\200\345\215\225\351\223\276\350\241\250/\347\256\200\345\215\225\351\223\276\350\241\250.cpp" create mode 100644 "\347\256\200\345\215\225\351\223\276\350\241\250/\347\256\200\345\215\225\351\223\276\350\241\250.vcxproj" create mode 100644 "\347\256\200\345\215\225\351\223\276\350\241\250/\347\256\200\345\215\225\351\223\276\350\241\250.vcxproj.filters" diff --git "a/\347\256\200\345\215\225\351\223\276\350\241\250.sln" "b/\347\256\200\345\215\225\351\223\276\350\241\250.sln" new file mode 100644 index 0000000..ef14b10 --- /dev/null +++ "b/\347\256\200\345\215\225\351\223\276\350\241\250.sln" @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.329 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "简单链表", "简单链表\简单链表.vcxproj", "{A5797DF3-6196-4462-B47E-4B7C9E0CBFFF}" +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 + {A5797DF3-6196-4462-B47E-4B7C9E0CBFFF}.Debug|x64.ActiveCfg = Debug|x64 + {A5797DF3-6196-4462-B47E-4B7C9E0CBFFF}.Debug|x64.Build.0 = Debug|x64 + {A5797DF3-6196-4462-B47E-4B7C9E0CBFFF}.Debug|x86.ActiveCfg = Debug|Win32 + {A5797DF3-6196-4462-B47E-4B7C9E0CBFFF}.Debug|x86.Build.0 = Debug|Win32 + {A5797DF3-6196-4462-B47E-4B7C9E0CBFFF}.Release|x64.ActiveCfg = Release|x64 + {A5797DF3-6196-4462-B47E-4B7C9E0CBFFF}.Release|x64.Build.0 = Release|x64 + {A5797DF3-6196-4462-B47E-4B7C9E0CBFFF}.Release|x86.ActiveCfg = Release|Win32 + {A5797DF3-6196-4462-B47E-4B7C9E0CBFFF}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {058A509D-B57E-4C50-97D4-7C5F04D20740} + EndGlobalSection +EndGlobal diff --git "a/\347\256\200\345\215\225\351\223\276\350\241\250/pch.cpp" "b/\347\256\200\345\215\225\351\223\276\350\241\250/pch.cpp" new file mode 100644 index 0000000..8eb50d0 --- /dev/null +++ "b/\347\256\200\345\215\225\351\223\276\350\241\250/pch.cpp" @@ -0,0 +1,5 @@ +// pch.cpp: 与预编译标头对应的源文件;编译成功所必需的 + +#include "pch.h" + +// 一般情况下,忽略此文件,但如果你使用的是预编译标头,请保留它。 diff --git "a/\347\256\200\345\215\225\351\223\276\350\241\250/pch.h" "b/\347\256\200\345\215\225\351\223\276\350\241\250/pch.h" new file mode 100644 index 0000000..69bf59d --- /dev/null +++ "b/\347\256\200\345\215\225\351\223\276\350\241\250/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/\347\256\200\345\215\225\351\223\276\350\241\250/\347\256\200\345\215\225\351\223\276\350\241\250.cpp" "b/\347\256\200\345\215\225\351\223\276\350\241\250/\347\256\200\345\215\225\351\223\276\350\241\250.cpp" new file mode 100644 index 0000000..804f7a4 --- /dev/null +++ "b/\347\256\200\345\215\225\351\223\276\350\241\250/\347\256\200\345\215\225\351\223\276\350\241\250.cpp" @@ -0,0 +1,59 @@ +// 简单链表.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 +// + +#include "pch.h" +#include +using namespace std; +typedef int DATA; +struct SNode +{ + DATA data; + SNode* pNext; +}; +struct SList +{ + int k = 0; + SNode* n_pHead; + SList() + { + k++; + n_pHead = NULL; + } + ~SList() + { + cout << "正在发生析构" << " " << k << endl; + } + void AddHead(DATA d) + { + SNode* p = new SNode; + p->data = d; + p->pNext = n_pHead; + n_pHead = p; + } +}; +int main() +{ + SList list1, list2; + cout << "请输入一个数据" << endl; + DATA d; + cin >> d; + cout << "请输入存入的链表:(1或2)"; + int i = 0; + cin >> i; + if (i == 1) + list1.AddHead(d); + if (i == 2) + list2.AddHead(d); + std::cout << "Hello World!\n"; +} + +// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单 +// 调试程序: F5 或调试 >“开始调试”菜单 + +// 入门提示: +// 1. 使用解决方案资源管理器窗口添加/管理文件 +// 2. 使用团队资源管理器窗口连接到源代码管理 +// 3. 使用输出窗口查看生成输出和其他消息 +// 4. 使用错误列表窗口查看错误 +// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目 +// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件 diff --git "a/\347\256\200\345\215\225\351\223\276\350\241\250/\347\256\200\345\215\225\351\223\276\350\241\250.vcxproj" "b/\347\256\200\345\215\225\351\223\276\350\241\250/\347\256\200\345\215\225\351\223\276\350\241\250.vcxproj" new file mode 100644 index 0000000..c7ce9aa --- /dev/null +++ "b/\347\256\200\345\215\225\351\223\276\350\241\250/\347\256\200\345\215\225\351\223\276\350\241\250.vcxproj" @@ -0,0 +1,168 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {A5797DF3-6196-4462-B47E-4B7C9E0CBFFF} + Win32Proj + 简单链表 + 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/\347\256\200\345\215\225\351\223\276\350\241\250/\347\256\200\345\215\225\351\223\276\350\241\250.vcxproj.filters" "b/\347\256\200\345\215\225\351\223\276\350\241\250/\347\256\200\345\215\225\351\223\276\350\241\250.vcxproj.filters" new file mode 100644 index 0000000..5751082 --- /dev/null +++ "b/\347\256\200\345\215\225\351\223\276\350\241\250/\347\256\200\345\215\225\351\223\276\350\241\250.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;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 -- GitLab