diff --git a/Classwork6/Classwork6.sln b/Classwork6/Classwork6.sln new file mode 100644 index 0000000..29cd983 --- /dev/null +++ b/Classwork6/Classwork6.sln @@ -0,0 +1,71 @@ + +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}") = "S6_1", "S6_1\S6_1.vcxproj", "{669FF81B-55E1-401D-B80F-C0ED50FF2648}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S6_2", "S6_2\S6_2.vcxproj", "{96201599-ECCC-48F0-BBEE-0014C1EC54AF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S6_3", "S6_3\S6_3.vcxproj", "{35FBCCA5-D3E7-4EF0-BE61-8CAF476DA304}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S6_4", "S6_4\S6_4.vcxproj", "{76E627A4-5DB9-428A-A99F-1561C0E4B3D6}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S6_5", "S6_5\S6_5.vcxproj", "{CE0C82DA-2542-41F0-8BAC-7D0B49BCE479}" +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 + {669FF81B-55E1-401D-B80F-C0ED50FF2648}.Debug|x64.ActiveCfg = Debug|x64 + {669FF81B-55E1-401D-B80F-C0ED50FF2648}.Debug|x64.Build.0 = Debug|x64 + {669FF81B-55E1-401D-B80F-C0ED50FF2648}.Debug|x86.ActiveCfg = Debug|Win32 + {669FF81B-55E1-401D-B80F-C0ED50FF2648}.Debug|x86.Build.0 = Debug|Win32 + {669FF81B-55E1-401D-B80F-C0ED50FF2648}.Release|x64.ActiveCfg = Release|x64 + {669FF81B-55E1-401D-B80F-C0ED50FF2648}.Release|x64.Build.0 = Release|x64 + {669FF81B-55E1-401D-B80F-C0ED50FF2648}.Release|x86.ActiveCfg = Release|Win32 + {669FF81B-55E1-401D-B80F-C0ED50FF2648}.Release|x86.Build.0 = Release|Win32 + {96201599-ECCC-48F0-BBEE-0014C1EC54AF}.Debug|x64.ActiveCfg = Debug|x64 + {96201599-ECCC-48F0-BBEE-0014C1EC54AF}.Debug|x64.Build.0 = Debug|x64 + {96201599-ECCC-48F0-BBEE-0014C1EC54AF}.Debug|x86.ActiveCfg = Debug|Win32 + {96201599-ECCC-48F0-BBEE-0014C1EC54AF}.Debug|x86.Build.0 = Debug|Win32 + {96201599-ECCC-48F0-BBEE-0014C1EC54AF}.Release|x64.ActiveCfg = Release|x64 + {96201599-ECCC-48F0-BBEE-0014C1EC54AF}.Release|x64.Build.0 = Release|x64 + {96201599-ECCC-48F0-BBEE-0014C1EC54AF}.Release|x86.ActiveCfg = Release|Win32 + {96201599-ECCC-48F0-BBEE-0014C1EC54AF}.Release|x86.Build.0 = Release|Win32 + {35FBCCA5-D3E7-4EF0-BE61-8CAF476DA304}.Debug|x64.ActiveCfg = Debug|x64 + {35FBCCA5-D3E7-4EF0-BE61-8CAF476DA304}.Debug|x64.Build.0 = Debug|x64 + {35FBCCA5-D3E7-4EF0-BE61-8CAF476DA304}.Debug|x86.ActiveCfg = Debug|Win32 + {35FBCCA5-D3E7-4EF0-BE61-8CAF476DA304}.Debug|x86.Build.0 = Debug|Win32 + {35FBCCA5-D3E7-4EF0-BE61-8CAF476DA304}.Release|x64.ActiveCfg = Release|x64 + {35FBCCA5-D3E7-4EF0-BE61-8CAF476DA304}.Release|x64.Build.0 = Release|x64 + {35FBCCA5-D3E7-4EF0-BE61-8CAF476DA304}.Release|x86.ActiveCfg = Release|Win32 + {35FBCCA5-D3E7-4EF0-BE61-8CAF476DA304}.Release|x86.Build.0 = Release|Win32 + {76E627A4-5DB9-428A-A99F-1561C0E4B3D6}.Debug|x64.ActiveCfg = Debug|x64 + {76E627A4-5DB9-428A-A99F-1561C0E4B3D6}.Debug|x64.Build.0 = Debug|x64 + {76E627A4-5DB9-428A-A99F-1561C0E4B3D6}.Debug|x86.ActiveCfg = Debug|Win32 + {76E627A4-5DB9-428A-A99F-1561C0E4B3D6}.Debug|x86.Build.0 = Debug|Win32 + {76E627A4-5DB9-428A-A99F-1561C0E4B3D6}.Release|x64.ActiveCfg = Release|x64 + {76E627A4-5DB9-428A-A99F-1561C0E4B3D6}.Release|x64.Build.0 = Release|x64 + {76E627A4-5DB9-428A-A99F-1561C0E4B3D6}.Release|x86.ActiveCfg = Release|Win32 + {76E627A4-5DB9-428A-A99F-1561C0E4B3D6}.Release|x86.Build.0 = Release|Win32 + {CE0C82DA-2542-41F0-8BAC-7D0B49BCE479}.Debug|x64.ActiveCfg = Debug|x64 + {CE0C82DA-2542-41F0-8BAC-7D0B49BCE479}.Debug|x64.Build.0 = Debug|x64 + {CE0C82DA-2542-41F0-8BAC-7D0B49BCE479}.Debug|x86.ActiveCfg = Debug|Win32 + {CE0C82DA-2542-41F0-8BAC-7D0B49BCE479}.Debug|x86.Build.0 = Debug|Win32 + {CE0C82DA-2542-41F0-8BAC-7D0B49BCE479}.Release|x64.ActiveCfg = Release|x64 + {CE0C82DA-2542-41F0-8BAC-7D0B49BCE479}.Release|x64.Build.0 = Release|x64 + {CE0C82DA-2542-41F0-8BAC-7D0B49BCE479}.Release|x86.ActiveCfg = Release|Win32 + {CE0C82DA-2542-41F0-8BAC-7D0B49BCE479}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {26C81428-6C78-4E90-BA84-73725A518473} + EndGlobalSection +EndGlobal diff --git a/Classwork6/S6_1/S6_1.cpp b/Classwork6/S6_1/S6_1.cpp new file mode 100644 index 0000000..5124b01 --- /dev/null +++ b/Classwork6/S6_1/S6_1.cpp @@ -0,0 +1,20 @@ +#include +using namespace std; +float fun(float x) +{ + float y; + y = 2 * x * x + 5 * x + 3; + return y; +} +int main() +{ + float y1, y2; + y1 = fun(1.0); + y2 = fun(1.2); + cout << "y1=" << y1 << endl; + cout << "y2=" << y2 << endl; + return 0; +} + +// y1=10 +// y2=11.88 \ No newline at end of file diff --git a/Classwork6/S6_1/S6_1.vcxproj b/Classwork6/S6_1/S6_1.vcxproj new file mode 100644 index 0000000..ecff331 --- /dev/null +++ b/Classwork6/S6_1/S6_1.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {669ff81b-55e1-401d-b80f-c0ed50ff2648} + S61 + 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/Classwork6/S6_1/S6_1.vcxproj.filters b/Classwork6/S6_1/S6_1.vcxproj.filters new file mode 100644 index 0000000..2396fa7 --- /dev/null +++ b/Classwork6/S6_1/S6_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/Classwork6/S6_2/S6_2.cpp b/Classwork6/S6_2/S6_2.cpp new file mode 100644 index 0000000..46f6cd1 --- /dev/null +++ b/Classwork6/S6_2/S6_2.cpp @@ -0,0 +1,27 @@ +#include +#include +using namespace std; +float f(float x) +{ + float y; + y = x * x + 3 * x - 4; + return y; +} +float df(float x) +{ + float y; + y = 2 * x + 3; + return y; +} +int main() +{ + float x1, x0; + x1 = 0; + do + { + x0 = x1; + x1 = x0 - f(x0) / df(x0); + } while (abs(f(x1)) > 10e-5); + cout << "x=" << x1 << endl; + return 0; +} \ No newline at end of file diff --git a/Classwork6/S6_2/S6_2.vcxproj b/Classwork6/S6_2/S6_2.vcxproj new file mode 100644 index 0000000..31565a0 --- /dev/null +++ b/Classwork6/S6_2/S6_2.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {96201599-eccc-48f0-bbee-0014c1ec54af} + S62 + 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/Classwork6/S6_2/S6_2.vcxproj.filters b/Classwork6/S6_2/S6_2.vcxproj.filters new file mode 100644 index 0000000..adc0033 --- /dev/null +++ b/Classwork6/S6_2/S6_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/Classwork6/S6_3/S6_3.cpp b/Classwork6/S6_3/S6_3.cpp new file mode 100644 index 0000000..bd352f4 --- /dev/null +++ b/Classwork6/S6_3/S6_3.cpp @@ -0,0 +1,30 @@ +#include +#include +using namespace std; +float f(float x) +{ + return x * x + 3 * x - 4; +} +int main() +{ + float x1, x2, x0; + do + { + cout << "ֵx1x2:"; + cin >> x1 >> x2; + } while ((f(x1) * f(x2)) > 0); + do + { + x0 = (x1 + x2) / 2; + if (f(x0) * f(x1) > 0) + x1 = x0; + else + x2 = x0; + } while (fabs(f(x0)) > 1e-5); + cout << "x0=" << x0 << endl; + return 0; +} + +// 0 2 -> 1 +// -5 0 -> -4 +// 0 -2 x \ No newline at end of file diff --git a/Classwork6/S6_3/S6_3.vcxproj b/Classwork6/S6_3/S6_3.vcxproj new file mode 100644 index 0000000..6517fdd --- /dev/null +++ b/Classwork6/S6_3/S6_3.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {35fbcca5-d3e7-4ef0-be61-8caf476da304} + S63 + 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/Classwork6/S6_3/S6_3.vcxproj.filters b/Classwork6/S6_3/S6_3.vcxproj.filters new file mode 100644 index 0000000..edf575e --- /dev/null +++ b/Classwork6/S6_3/S6_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/Classwork6/S6_4/S6_4.cpp b/Classwork6/S6_4/S6_4.cpp new file mode 100644 index 0000000..b743b02 --- /dev/null +++ b/Classwork6/S6_4/S6_4.cpp @@ -0,0 +1,32 @@ +#include +#include +using namespace std; +float f(float x) +{ + float y; + y = x * x + 3 * x - 4; + return y; +} +int main() +{ + float x1, x2, x0; + do + { + cout << "ֵx1x2:"; + cin >> x1 >> x2; + } while ((f(x1) * f(x2)) > 0); + do + { + x0 = (x1 * f(x2) - x2 * f(x1)) / (f(x2) - f(x1)); + if (f(x0) * f(x1) > 0) + x1 = x0; + else + x2 = x0; + } while (fabs(f(x0)) > 1e-5); + cout << "x0=" << x0 << endl; + return 0; +} + +// 0 2 -> 0.999999 +// -5 4 -> -4 +// 0 -2 x \ No newline at end of file diff --git a/Classwork6/S6_4/S6_4.vcxproj b/Classwork6/S6_4/S6_4.vcxproj new file mode 100644 index 0000000..bd5eb5d --- /dev/null +++ b/Classwork6/S6_4/S6_4.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {76e627a4-5db9-428a-a99f-1561c0e4b3d6} + S64 + 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/Classwork6/S6_4/S6_4.vcxproj.filters b/Classwork6/S6_4/S6_4.vcxproj.filters new file mode 100644 index 0000000..efc8dba --- /dev/null +++ b/Classwork6/S6_4/S6_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/Classwork6/S6_5/S6_5.cpp b/Classwork6/S6_5/S6_5.cpp new file mode 100644 index 0000000..36dc943 --- /dev/null +++ b/Classwork6/S6_5/S6_5.cpp @@ -0,0 +1,26 @@ +#include +#include +using namespace std; +float f(float x) +{ + return x * x + 3 * x - 4; +} +float df(float x) +{ + return 2 * x + 3; +} +float calc(float a) +{ + float b; + b = a - f(a) / df(a); + if (fabs(f(b)) < 10e-5) + return b; + else + calc(b); +} +int main() +{ + float x = 0; + cout << calc(x) << endl; + return 0; +} \ No newline at end of file diff --git a/Classwork6/S6_5/S6_5.vcxproj b/Classwork6/S6_5/S6_5.vcxproj new file mode 100644 index 0000000..8d21edc --- /dev/null +++ b/Classwork6/S6_5/S6_5.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {ce0c82da-2542-41f0-8bac-7d0b49bce479} + S65 + 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/Classwork6/S6_5/S6_5.vcxproj.filters b/Classwork6/S6_5/S6_5.vcxproj.filters new file mode 100644 index 0000000..7b10398 --- /dev/null +++ b/Classwork6/S6_5/S6_5.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/Classwork6/实验报告.doc b/Classwork6/实验报告.doc new file mode 100644 index 0000000..56d192f Binary files /dev/null and b/Classwork6/实验报告.doc differ diff --git a/Classwork7/Classwork7.sln b/Classwork7/Classwork7.sln new file mode 100644 index 0000000..566e4f6 --- /dev/null +++ b/Classwork7/Classwork7.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}") = "S7_1", "S7_1\S7_1.vcxproj", "{234BB566-9F04-4576-A991-EBB5038A832B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S7_2", "S7_2\S7_2.vcxproj", "{1AC04E2D-E217-49C8-8524-C134DE2E2CF1}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S7_3", "S7_3\S7_3.vcxproj", "{DADA6E73-6D3E-4BAC-B368-7D363ABCCD4C}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S7_4", "S7_4\S7_4.vcxproj", "{447415D3-6F48-4218-8CB5-255FB5E50346}" +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 + {234BB566-9F04-4576-A991-EBB5038A832B}.Debug|x64.ActiveCfg = Debug|x64 + {234BB566-9F04-4576-A991-EBB5038A832B}.Debug|x64.Build.0 = Debug|x64 + {234BB566-9F04-4576-A991-EBB5038A832B}.Debug|x86.ActiveCfg = Debug|Win32 + {234BB566-9F04-4576-A991-EBB5038A832B}.Debug|x86.Build.0 = Debug|Win32 + {234BB566-9F04-4576-A991-EBB5038A832B}.Release|x64.ActiveCfg = Release|x64 + {234BB566-9F04-4576-A991-EBB5038A832B}.Release|x64.Build.0 = Release|x64 + {234BB566-9F04-4576-A991-EBB5038A832B}.Release|x86.ActiveCfg = Release|Win32 + {234BB566-9F04-4576-A991-EBB5038A832B}.Release|x86.Build.0 = Release|Win32 + {1AC04E2D-E217-49C8-8524-C134DE2E2CF1}.Debug|x64.ActiveCfg = Debug|x64 + {1AC04E2D-E217-49C8-8524-C134DE2E2CF1}.Debug|x64.Build.0 = Debug|x64 + {1AC04E2D-E217-49C8-8524-C134DE2E2CF1}.Debug|x86.ActiveCfg = Debug|Win32 + {1AC04E2D-E217-49C8-8524-C134DE2E2CF1}.Debug|x86.Build.0 = Debug|Win32 + {1AC04E2D-E217-49C8-8524-C134DE2E2CF1}.Release|x64.ActiveCfg = Release|x64 + {1AC04E2D-E217-49C8-8524-C134DE2E2CF1}.Release|x64.Build.0 = Release|x64 + {1AC04E2D-E217-49C8-8524-C134DE2E2CF1}.Release|x86.ActiveCfg = Release|Win32 + {1AC04E2D-E217-49C8-8524-C134DE2E2CF1}.Release|x86.Build.0 = Release|Win32 + {DADA6E73-6D3E-4BAC-B368-7D363ABCCD4C}.Debug|x64.ActiveCfg = Debug|x64 + {DADA6E73-6D3E-4BAC-B368-7D363ABCCD4C}.Debug|x64.Build.0 = Debug|x64 + {DADA6E73-6D3E-4BAC-B368-7D363ABCCD4C}.Debug|x86.ActiveCfg = Debug|Win32 + {DADA6E73-6D3E-4BAC-B368-7D363ABCCD4C}.Debug|x86.Build.0 = Debug|Win32 + {DADA6E73-6D3E-4BAC-B368-7D363ABCCD4C}.Release|x64.ActiveCfg = Release|x64 + {DADA6E73-6D3E-4BAC-B368-7D363ABCCD4C}.Release|x64.Build.0 = Release|x64 + {DADA6E73-6D3E-4BAC-B368-7D363ABCCD4C}.Release|x86.ActiveCfg = Release|Win32 + {DADA6E73-6D3E-4BAC-B368-7D363ABCCD4C}.Release|x86.Build.0 = Release|Win32 + {447415D3-6F48-4218-8CB5-255FB5E50346}.Debug|x64.ActiveCfg = Debug|x64 + {447415D3-6F48-4218-8CB5-255FB5E50346}.Debug|x64.Build.0 = Debug|x64 + {447415D3-6F48-4218-8CB5-255FB5E50346}.Debug|x86.ActiveCfg = Debug|Win32 + {447415D3-6F48-4218-8CB5-255FB5E50346}.Debug|x86.Build.0 = Debug|Win32 + {447415D3-6F48-4218-8CB5-255FB5E50346}.Release|x64.ActiveCfg = Release|x64 + {447415D3-6F48-4218-8CB5-255FB5E50346}.Release|x64.Build.0 = Release|x64 + {447415D3-6F48-4218-8CB5-255FB5E50346}.Release|x86.ActiveCfg = Release|Win32 + {447415D3-6F48-4218-8CB5-255FB5E50346}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A4C611DA-F14D-4C1D-88D7-52091ADC2AF9} + EndGlobalSection +EndGlobal diff --git a/Classwork7/S7_1/S7_1.cpp b/Classwork7/S7_1/S7_1.cpp new file mode 100644 index 0000000..06485e8 --- /dev/null +++ b/Classwork7/S7_1/S7_1.cpp @@ -0,0 +1,20 @@ +#include +using namespace std; +int prime(int x) +{ + for (int i = 2; i < x; i++) + if (x % i == 0) + return 0; + return 1; +} +int main() +{ + for (int i = 100; i <= 200; i++) + { + if (prime(i) == 1) + cout << i << '\t'; + } + return 0; +} + +// 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 \ No newline at end of file diff --git a/Classwork7/S7_1/S7_1.vcxproj b/Classwork7/S7_1/S7_1.vcxproj new file mode 100644 index 0000000..1a60a83 --- /dev/null +++ b/Classwork7/S7_1/S7_1.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {234bb566-9f04-4576-a991-ebb5038a832b} + S71 + 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/Classwork7/S7_1/S7_1.vcxproj.filters b/Classwork7/S7_1/S7_1.vcxproj.filters new file mode 100644 index 0000000..c7ac8a7 --- /dev/null +++ b/Classwork7/S7_1/S7_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/Classwork7/S7_2/S7_2.cpp b/Classwork7/S7_2/S7_2.cpp new file mode 100644 index 0000000..c92884f --- /dev/null +++ b/Classwork7/S7_2/S7_2.cpp @@ -0,0 +1,24 @@ +#include +using namespace std; +int prime(int num) +{ + for (int i = 2; i < num; i++) + if (num % i == 0) + return 0; + return 1; +} +int main() +{ + int n; + cout << "һn:"; + cin >> n; + for(int i=2;i<=n/2;i++) + { + if ((prime(i) == 1) && (n % i == 0)) + cout << i << '\t'; + } + cout << endl; + return 0; +} + +// 2145 -> 3 5 11 13 \ No newline at end of file diff --git a/Classwork7/S7_2/S7_2.vcxproj b/Classwork7/S7_2/S7_2.vcxproj new file mode 100644 index 0000000..54016d3 --- /dev/null +++ b/Classwork7/S7_2/S7_2.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {1ac04e2d-e217-49c8-8524-c134de2e2cf1} + S72 + 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/Classwork7/S7_2/S7_2.vcxproj.filters b/Classwork7/S7_2/S7_2.vcxproj.filters new file mode 100644 index 0000000..1d9df26 --- /dev/null +++ b/Classwork7/S7_2/S7_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/Classwork7/S7_3/S7_3.cpp b/Classwork7/S7_3/S7_3.cpp new file mode 100644 index 0000000..87ccf57 --- /dev/null +++ b/Classwork7/S7_3/S7_3.cpp @@ -0,0 +1,31 @@ +#include +using namespace std; +int prime(int num) +{ + for (int i = 2; i < num; i++) + if (num % i == 0) + return 0; + return 1; +} +int main() +{ + int x, n, m; + cout << "һС6ż:"; + cin >> x; + for (n = 1; n <= x / 2; n++) + { + m = x - n; + if ((prime(n) == 1) && (prime(m) == 1)) + cout << x << '=' << n << '+' << m << endl; + } + return 0; +} + +// 56=3+53 +// 56=13+43 +// 56=19+37 + +// 122=13+109 +// 122=19+103 +// 122=43+79 +// 122=61+61 \ No newline at end of file diff --git a/Classwork7/S7_3/S7_3.vcxproj b/Classwork7/S7_3/S7_3.vcxproj new file mode 100644 index 0000000..5f0a8a0 --- /dev/null +++ b/Classwork7/S7_3/S7_3.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {dada6e73-6d3e-4bac-b368-7d363abccd4c} + S73 + 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/Classwork7/S7_3/S7_3.vcxproj.filters b/Classwork7/S7_3/S7_3.vcxproj.filters new file mode 100644 index 0000000..0b27814 --- /dev/null +++ b/Classwork7/S7_3/S7_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/Classwork7/S7_4/S7_4.cpp b/Classwork7/S7_4/S7_4.cpp new file mode 100644 index 0000000..3ab57a8 --- /dev/null +++ b/Classwork7/S7_4/S7_4.cpp @@ -0,0 +1,30 @@ +#include +using namespace std; +int fun(int num) +{ + int a = 1, b; + while (true) + { + b = num % 10; + a *= b; + num /= 10; + if (num == 0) + return a; + } +} +int main() +{ + int n, mul; + cout << "һ(0):"; + cin >> n; + while(n) + { + mul = fun(n); + cout << n << "ĸλ֮Ϊ" << mul << endl; + cout << "һ(0):"; + cin >> n; + } + return 0; +} + +// 24 32 0 -> 8 6 \ No newline at end of file diff --git a/Classwork7/S7_4/S7_4.vcxproj b/Classwork7/S7_4/S7_4.vcxproj new file mode 100644 index 0000000..40b17c8 --- /dev/null +++ b/Classwork7/S7_4/S7_4.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {447415d3-6f48-4218-8cb5-255fb5e50346} + S74 + 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/Classwork7/S7_4/S7_4.vcxproj.filters b/Classwork7/S7_4/S7_4.vcxproj.filters new file mode 100644 index 0000000..d9465a7 --- /dev/null +++ b/Classwork7/S7_4/S7_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/Classwork7/实验报告.doc b/Classwork7/实验报告.doc new file mode 100644 index 0000000..e43c561 Binary files /dev/null and b/Classwork7/实验报告.doc differ