diff --git a/Classwork3/实验报告.doc b/Classwork3/实验报告.doc new file mode 100644 index 0000000..2dbc660 Binary files /dev/null and b/Classwork3/实验报告.doc differ diff --git a/Classwork4/实验报告.doc b/Classwork4/实验报告.doc new file mode 100644 index 0000000..22e20be Binary files /dev/null and b/Classwork4/实验报告.doc differ diff --git a/Classwork5/Classwork5.sln b/Classwork5/Classwork5.sln new file mode 100644 index 0000000..dd7bab2 --- /dev/null +++ b/Classwork5/Classwork5.sln @@ -0,0 +1,61 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34202.233 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S5_1", "S5_1\S5_1.vcxproj", "{53C4E68E-DEDB-47D7-AC4B-11B9D53F3F83}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S5_3", "S5_3\S5_3.vcxproj", "{C4B15A41-F945-41D5-AC8C-8422A599BD35}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S5_2", "S5_2\S5_2.vcxproj", "{AA5F01DE-4709-4215-BD8D-71B7835CFDA3}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S5_4", "S5_4\S5_4.vcxproj", "{E3ECDBEC-48DF-4F5E-8DDE-26ADB3F0D3DC}" +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 + {53C4E68E-DEDB-47D7-AC4B-11B9D53F3F83}.Debug|x64.ActiveCfg = Debug|x64 + {53C4E68E-DEDB-47D7-AC4B-11B9D53F3F83}.Debug|x64.Build.0 = Debug|x64 + {53C4E68E-DEDB-47D7-AC4B-11B9D53F3F83}.Debug|x86.ActiveCfg = Debug|Win32 + {53C4E68E-DEDB-47D7-AC4B-11B9D53F3F83}.Debug|x86.Build.0 = Debug|Win32 + {53C4E68E-DEDB-47D7-AC4B-11B9D53F3F83}.Release|x64.ActiveCfg = Release|x64 + {53C4E68E-DEDB-47D7-AC4B-11B9D53F3F83}.Release|x64.Build.0 = Release|x64 + {53C4E68E-DEDB-47D7-AC4B-11B9D53F3F83}.Release|x86.ActiveCfg = Release|Win32 + {53C4E68E-DEDB-47D7-AC4B-11B9D53F3F83}.Release|x86.Build.0 = Release|Win32 + {C4B15A41-F945-41D5-AC8C-8422A599BD35}.Debug|x64.ActiveCfg = Debug|x64 + {C4B15A41-F945-41D5-AC8C-8422A599BD35}.Debug|x64.Build.0 = Debug|x64 + {C4B15A41-F945-41D5-AC8C-8422A599BD35}.Debug|x86.ActiveCfg = Debug|Win32 + {C4B15A41-F945-41D5-AC8C-8422A599BD35}.Debug|x86.Build.0 = Debug|Win32 + {C4B15A41-F945-41D5-AC8C-8422A599BD35}.Release|x64.ActiveCfg = Release|x64 + {C4B15A41-F945-41D5-AC8C-8422A599BD35}.Release|x64.Build.0 = Release|x64 + {C4B15A41-F945-41D5-AC8C-8422A599BD35}.Release|x86.ActiveCfg = Release|Win32 + {C4B15A41-F945-41D5-AC8C-8422A599BD35}.Release|x86.Build.0 = Release|Win32 + {AA5F01DE-4709-4215-BD8D-71B7835CFDA3}.Debug|x64.ActiveCfg = Debug|x64 + {AA5F01DE-4709-4215-BD8D-71B7835CFDA3}.Debug|x64.Build.0 = Debug|x64 + {AA5F01DE-4709-4215-BD8D-71B7835CFDA3}.Debug|x86.ActiveCfg = Debug|Win32 + {AA5F01DE-4709-4215-BD8D-71B7835CFDA3}.Debug|x86.Build.0 = Debug|Win32 + {AA5F01DE-4709-4215-BD8D-71B7835CFDA3}.Release|x64.ActiveCfg = Release|x64 + {AA5F01DE-4709-4215-BD8D-71B7835CFDA3}.Release|x64.Build.0 = Release|x64 + {AA5F01DE-4709-4215-BD8D-71B7835CFDA3}.Release|x86.ActiveCfg = Release|Win32 + {AA5F01DE-4709-4215-BD8D-71B7835CFDA3}.Release|x86.Build.0 = Release|Win32 + {E3ECDBEC-48DF-4F5E-8DDE-26ADB3F0D3DC}.Debug|x64.ActiveCfg = Debug|x64 + {E3ECDBEC-48DF-4F5E-8DDE-26ADB3F0D3DC}.Debug|x64.Build.0 = Debug|x64 + {E3ECDBEC-48DF-4F5E-8DDE-26ADB3F0D3DC}.Debug|x86.ActiveCfg = Debug|Win32 + {E3ECDBEC-48DF-4F5E-8DDE-26ADB3F0D3DC}.Debug|x86.Build.0 = Debug|Win32 + {E3ECDBEC-48DF-4F5E-8DDE-26ADB3F0D3DC}.Release|x64.ActiveCfg = Release|x64 + {E3ECDBEC-48DF-4F5E-8DDE-26ADB3F0D3DC}.Release|x64.Build.0 = Release|x64 + {E3ECDBEC-48DF-4F5E-8DDE-26ADB3F0D3DC}.Release|x86.ActiveCfg = Release|Win32 + {E3ECDBEC-48DF-4F5E-8DDE-26ADB3F0D3DC}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {2ADC7E56-C6AD-483C-A59A-F2F2AD706623} + EndGlobalSection +EndGlobal diff --git a/Classwork5/S5_1/S5_1.cpp b/Classwork5/S5_1/S5_1.cpp new file mode 100644 index 0000000..64de720 --- /dev/null +++ b/Classwork5/S5_1/S5_1.cpp @@ -0,0 +1,16 @@ +#include +using namespace std; +int main() +{ + int t = 2; + int s = 0; + for (int i=1;i<=7;i++) + { + s = s + t; + t = t * 10 + 2; + } + cout << "2+22+222+...+2222222=" << s << endl; + return 0; +} + +// 2+22+222+...+2222222=2469134 \ No newline at end of file diff --git a/Classwork5/S5_1/S5_1.vcxproj b/Classwork5/S5_1/S5_1.vcxproj new file mode 100644 index 0000000..a1364ec --- /dev/null +++ b/Classwork5/S5_1/S5_1.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {53c4e68e-dedb-47d7-ac4b-11b9d53f3f83} + S51 + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/Classwork5/S5_1/S5_1.vcxproj.filters b/Classwork5/S5_1/S5_1.vcxproj.filters new file mode 100644 index 0000000..b927d3f --- /dev/null +++ b/Classwork5/S5_1/S5_1.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;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/Classwork5/S5_2/S5_2.cpp b/Classwork5/S5_2/S5_2.cpp new file mode 100644 index 0000000..bdba89f --- /dev/null +++ b/Classwork5/S5_2/S5_2.cpp @@ -0,0 +1,18 @@ +#include +using namespace std; +int main() +{ + float y = 1, t = 1; + int n; + cout << "Input n:"; + cin >> n; + for (int i=2;i<=n;i++) + { + t = t * i; + y = y + t; + } + cout << "1!+2!+3!+...+" << n << "! = " << y << endl; + return 0; +} + +// 6 -> 873 \ No newline at end of file diff --git a/Classwork5/S5_2/S5_2.vcxproj b/Classwork5/S5_2/S5_2.vcxproj new file mode 100644 index 0000000..7a7b23b --- /dev/null +++ b/Classwork5/S5_2/S5_2.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {aa5f01de-4709-4215-bd8d-71b7835cfda3} + S52 + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/Classwork5/S5_2/S5_2.vcxproj.filters b/Classwork5/S5_2/S5_2.vcxproj.filters new file mode 100644 index 0000000..b2b2265 --- /dev/null +++ b/Classwork5/S5_2/S5_2.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;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/Classwork5/S5_3/S5_3.cpp b/Classwork5/S5_3/S5_3.cpp new file mode 100644 index 0000000..06bd786 --- /dev/null +++ b/Classwork5/S5_3/S5_3.cpp @@ -0,0 +1,16 @@ +#include +#include +using namespace std; +int main() +{ + double x, y, z; + cin >> x; + z = x; + do + { + y = z; + z = ((2.0 / 3.0) * y) + (x / (3 * y * y)); + } while (fabs(z - y) > 10e-5); + cout << y << endl; + return 0; +} \ No newline at end of file diff --git a/Classwork5/S5_3/S5_3.vcxproj b/Classwork5/S5_3/S5_3.vcxproj new file mode 100644 index 0000000..97c2acd --- /dev/null +++ b/Classwork5/S5_3/S5_3.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {c4b15a41-f945-41d5-ac8c-8422a599bd35} + S53 + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/Classwork5/S5_3/S5_3.vcxproj.filters b/Classwork5/S5_3/S5_3.vcxproj.filters new file mode 100644 index 0000000..c21cf95 --- /dev/null +++ b/Classwork5/S5_3/S5_3.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;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/Classwork5/S5_4/S5_4.cpp b/Classwork5/S5_4/S5_4.cpp new file mode 100644 index 0000000..08b5a9d --- /dev/null +++ b/Classwork5/S5_4/S5_4.cpp @@ -0,0 +1,25 @@ +#include +#include +using namespace std; +int main() +{ + long double x, y=0, o; + long long int i, j, n, r, p; + cout << "x="; + cin >> x; + cout << "n="; + cin >> n; + for (i = 1; i <= 2 * n - 1; i = i + 2) + { + if ((((i - 1) / 2) % 2) == 0) r = 1; else r = -1; + o = 1; p = 1; + o = pow(x, i); + for (j=1; j<=i; j++) + { + p = p * j; + } + y = y + (r * (o / p)); + } + cout << "y=" << y << endl; + return 0; +} \ No newline at end of file diff --git a/Classwork5/S5_4/S5_4.vcxproj b/Classwork5/S5_4/S5_4.vcxproj new file mode 100644 index 0000000..86b895e --- /dev/null +++ b/Classwork5/S5_4/S5_4.vcxproj @@ -0,0 +1,137 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {e3ecdbec-48df-4f5e-8dde-26adb3f0d3dc} + S54 + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + false + + + + + + \ No newline at end of file diff --git a/Classwork5/S5_4/S5_4.vcxproj.filters b/Classwork5/S5_4/S5_4.vcxproj.filters new file mode 100644 index 0000000..49f3db5 --- /dev/null +++ b/Classwork5/S5_4/S5_4.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;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/Classwork5/实验报告.doc b/Classwork5/实验报告.doc new file mode 100644 index 0000000..a562afe Binary files /dev/null and b/Classwork5/实验报告.doc differ