diff --git a/Classwork10/Classwork10.sln b/Classwork10/Classwork10.sln new file mode 100644 index 0000000..e819937 --- /dev/null +++ b/Classwork10/Classwork10.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}") = "S10_1", "S10_1\S10_1.vcxproj", "{1D1B0C74-7A4E-4E7A-8BDF-7FB94EF54CD4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S10_2", "S10_2\S10_2.vcxproj", "{06D6308C-F61F-47D9-B697-C3BE327404F3}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S10_3", "S10_3\S10_3.vcxproj", "{707D34E7-AA79-4A7F-848D-37B23B270498}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S10_4", "S10_4\S10_4.vcxproj", "{65DDC283-08D3-4362-9E52-F794C080784E}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S10_5", "S10_5\S10_5.vcxproj", "{366BB3D7-C9C9-429F-8CA6-67E6524A0D77}" +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 + {1D1B0C74-7A4E-4E7A-8BDF-7FB94EF54CD4}.Debug|x64.ActiveCfg = Debug|x64 + {1D1B0C74-7A4E-4E7A-8BDF-7FB94EF54CD4}.Debug|x64.Build.0 = Debug|x64 + {1D1B0C74-7A4E-4E7A-8BDF-7FB94EF54CD4}.Debug|x86.ActiveCfg = Debug|Win32 + {1D1B0C74-7A4E-4E7A-8BDF-7FB94EF54CD4}.Debug|x86.Build.0 = Debug|Win32 + {1D1B0C74-7A4E-4E7A-8BDF-7FB94EF54CD4}.Release|x64.ActiveCfg = Release|x64 + {1D1B0C74-7A4E-4E7A-8BDF-7FB94EF54CD4}.Release|x64.Build.0 = Release|x64 + {1D1B0C74-7A4E-4E7A-8BDF-7FB94EF54CD4}.Release|x86.ActiveCfg = Release|Win32 + {1D1B0C74-7A4E-4E7A-8BDF-7FB94EF54CD4}.Release|x86.Build.0 = Release|Win32 + {06D6308C-F61F-47D9-B697-C3BE327404F3}.Debug|x64.ActiveCfg = Debug|x64 + {06D6308C-F61F-47D9-B697-C3BE327404F3}.Debug|x64.Build.0 = Debug|x64 + {06D6308C-F61F-47D9-B697-C3BE327404F3}.Debug|x86.ActiveCfg = Debug|Win32 + {06D6308C-F61F-47D9-B697-C3BE327404F3}.Debug|x86.Build.0 = Debug|Win32 + {06D6308C-F61F-47D9-B697-C3BE327404F3}.Release|x64.ActiveCfg = Release|x64 + {06D6308C-F61F-47D9-B697-C3BE327404F3}.Release|x64.Build.0 = Release|x64 + {06D6308C-F61F-47D9-B697-C3BE327404F3}.Release|x86.ActiveCfg = Release|Win32 + {06D6308C-F61F-47D9-B697-C3BE327404F3}.Release|x86.Build.0 = Release|Win32 + {707D34E7-AA79-4A7F-848D-37B23B270498}.Debug|x64.ActiveCfg = Debug|x64 + {707D34E7-AA79-4A7F-848D-37B23B270498}.Debug|x64.Build.0 = Debug|x64 + {707D34E7-AA79-4A7F-848D-37B23B270498}.Debug|x86.ActiveCfg = Debug|Win32 + {707D34E7-AA79-4A7F-848D-37B23B270498}.Debug|x86.Build.0 = Debug|Win32 + {707D34E7-AA79-4A7F-848D-37B23B270498}.Release|x64.ActiveCfg = Release|x64 + {707D34E7-AA79-4A7F-848D-37B23B270498}.Release|x64.Build.0 = Release|x64 + {707D34E7-AA79-4A7F-848D-37B23B270498}.Release|x86.ActiveCfg = Release|Win32 + {707D34E7-AA79-4A7F-848D-37B23B270498}.Release|x86.Build.0 = Release|Win32 + {65DDC283-08D3-4362-9E52-F794C080784E}.Debug|x64.ActiveCfg = Debug|x64 + {65DDC283-08D3-4362-9E52-F794C080784E}.Debug|x64.Build.0 = Debug|x64 + {65DDC283-08D3-4362-9E52-F794C080784E}.Debug|x86.ActiveCfg = Debug|Win32 + {65DDC283-08D3-4362-9E52-F794C080784E}.Debug|x86.Build.0 = Debug|Win32 + {65DDC283-08D3-4362-9E52-F794C080784E}.Release|x64.ActiveCfg = Release|x64 + {65DDC283-08D3-4362-9E52-F794C080784E}.Release|x64.Build.0 = Release|x64 + {65DDC283-08D3-4362-9E52-F794C080784E}.Release|x86.ActiveCfg = Release|Win32 + {65DDC283-08D3-4362-9E52-F794C080784E}.Release|x86.Build.0 = Release|Win32 + {366BB3D7-C9C9-429F-8CA6-67E6524A0D77}.Debug|x64.ActiveCfg = Debug|x64 + {366BB3D7-C9C9-429F-8CA6-67E6524A0D77}.Debug|x64.Build.0 = Debug|x64 + {366BB3D7-C9C9-429F-8CA6-67E6524A0D77}.Debug|x86.ActiveCfg = Debug|Win32 + {366BB3D7-C9C9-429F-8CA6-67E6524A0D77}.Debug|x86.Build.0 = Debug|Win32 + {366BB3D7-C9C9-429F-8CA6-67E6524A0D77}.Release|x64.ActiveCfg = Release|x64 + {366BB3D7-C9C9-429F-8CA6-67E6524A0D77}.Release|x64.Build.0 = Release|x64 + {366BB3D7-C9C9-429F-8CA6-67E6524A0D77}.Release|x86.ActiveCfg = Release|Win32 + {366BB3D7-C9C9-429F-8CA6-67E6524A0D77}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {3DDA5FCF-960E-4E46-8DC6-24E8327FC975} + EndGlobalSection +EndGlobal diff --git a/Classwork10/S10_1/S10_1.cpp b/Classwork10/S10_1/S10_1.cpp new file mode 100644 index 0000000..1acd8be --- /dev/null +++ b/Classwork10/S10_1/S10_1.cpp @@ -0,0 +1,34 @@ +#include +using namespace std; +int binary(int array[], int n, int number) +{ + int low = 0, high = n - 1, mid; + while(low<=high) + { + mid = (low + high) / 2; + if (number < array[mid]) + high = mid - 1; + else if (number > array[mid]) + low = mid + 1; + else + return mid; + } + return -1; +} +int main() +{ + int a[] = { 2,4,6,8,10,12,14,16,18,20,22,24 }; + int num; + cout << "ҪѰҵ:"; + cin >> num; + int index = binary(a, sizeof(a) / sizeof(a[0]), num); + if (index != -1) + cout << "еΪ:" << index << endl; + else + cout << "ûиԪ\n"; + return 0; +} + +// 4 -> 1 +// 24 -> 11 +// 3 (x) \ No newline at end of file diff --git a/Classwork10/S10_1/S10_1.vcxproj b/Classwork10/S10_1/S10_1.vcxproj new file mode 100644 index 0000000..525f70c --- /dev/null +++ b/Classwork10/S10_1/S10_1.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {1d1b0c74-7a4e-4e7a-8bdf-7fb94ef54cd4} + S101 + 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/Classwork10/S10_1/S10_1.vcxproj.filters b/Classwork10/S10_1/S10_1.vcxproj.filters new file mode 100644 index 0000000..20b8135 --- /dev/null +++ b/Classwork10/S10_1/S10_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/Classwork10/S10_2/S10_2.cpp b/Classwork10/S10_2/S10_2.cpp new file mode 100644 index 0000000..62dd0f2 --- /dev/null +++ b/Classwork10/S10_2/S10_2.cpp @@ -0,0 +1,23 @@ +#include +using namespace std; +int del(int array[], int n) +{ + for (int i = 0; i < n - 1; i++) + if (array[i] == array[i + 1]) + { + for (int j = i + 1; j < n; j++) + array[j - 1] = array[j]; + n = n - 1; + i = i - 1; + } + return n; +} +int main() +{ + int a[] = { 2,2,2,3,4,4,5,6,6,6,6,7,7,8,9,9,10,10,10 }; + int n = del(a, sizeof(a) / sizeof(a[0])); + for (int i = 0; i < n; i++) + cout << a[i] << '\t'; + cout << endl; + return 0; +} \ No newline at end of file diff --git a/Classwork10/S10_2/S10_2.vcxproj b/Classwork10/S10_2/S10_2.vcxproj new file mode 100644 index 0000000..1abe6bf --- /dev/null +++ b/Classwork10/S10_2/S10_2.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {06d6308c-f61f-47d9-b697-c3be327404f3} + S102 + 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/Classwork10/S10_2/S10_2.vcxproj.filters b/Classwork10/S10_2/S10_2.vcxproj.filters new file mode 100644 index 0000000..bbfa06c --- /dev/null +++ b/Classwork10/S10_2/S10_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/Classwork10/S10_3/S10_3.cpp b/Classwork10/S10_3/S10_3.cpp new file mode 100644 index 0000000..5645e7d --- /dev/null +++ b/Classwork10/S10_3/S10_3.cpp @@ -0,0 +1,48 @@ +#include +using namespace std; +int sum(int b[3][4], int k) +{ + int s = 0, i; + for (i = 0; i < 3; i++) + s += b[i][k]; + return s; +} +void exch(int b[3][4], int x, int y) +{ + int a[3]; + for (int i = 0; i < 3; i++) + { + a[i] = b[i][x]; + b[i][x] = b[i][y]; + b[i][y] = a[i]; + } +} +int main() +{ + int a[3][4] = { {5,8,10,15},{17,6,4,8},{6,15,9,12} }; + int i, j, m, t[4]; + cout << "ԭʼ:\n"; + for (i = 0; i < 3; i++) + { + for (j = 0; j < 4; j++) cout << a[i][j] << '\t'; + cout << endl; + } + for (i = 0; i < 4; i++) + t[i] = sum(a, i); + for (i = 2; i >= 0; i--) + for (j = 0; j < i + 1; j++) + if (t[j] > t[j + 1]) + { + m = t[j]; + t[j] = t[j + 1]; + t[j + 1] = m; + exch(a, j, j + 1); + } + cout << ":\n"; + for (i = 0; i < 3; i++) + { + for (j = 0; j < 4; j++) cout << a[i][j] << '\t'; + cout << endl; + } + return 0; +} \ No newline at end of file diff --git a/Classwork10/S10_3/S10_3.vcxproj b/Classwork10/S10_3/S10_3.vcxproj new file mode 100644 index 0000000..1f4e216 --- /dev/null +++ b/Classwork10/S10_3/S10_3.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {707d34e7-aa79-4a7f-848d-37b23b270498} + S103 + 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/Classwork10/S10_3/S10_3.vcxproj.filters b/Classwork10/S10_3/S10_3.vcxproj.filters new file mode 100644 index 0000000..6b4cbf2 --- /dev/null +++ b/Classwork10/S10_3/S10_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/Classwork10/S10_4/S10_4.cpp b/Classwork10/S10_4/S10_4.cpp new file mode 100644 index 0000000..e031d3f --- /dev/null +++ b/Classwork10/S10_4/S10_4.cpp @@ -0,0 +1,25 @@ +#include +using namespace std; +int main() +{ + int a[100]; + int b, c = 0, m; + while (true) + { + cin >> b; + if (b == 0) break; + a[c] = b; + for (int i = c - 1; i >= 0; i--) + if (a[i] > a[i + 1]) + { + m = a[i]; + a[i] = a[i + 1]; + a[i + 1] = m; + } + c++; + } + for (int j = 0; j < c; j++) + cout << a[j] << '\t'; + cout << endl; + return 0; +} \ No newline at end of file diff --git a/Classwork10/S10_4/S10_4.vcxproj b/Classwork10/S10_4/S10_4.vcxproj new file mode 100644 index 0000000..376c2cd --- /dev/null +++ b/Classwork10/S10_4/S10_4.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {65ddc283-08d3-4362-9e52-f794c080784e} + S104 + 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/Classwork10/S10_4/S10_4.vcxproj.filters b/Classwork10/S10_4/S10_4.vcxproj.filters new file mode 100644 index 0000000..b0fe6b5 --- /dev/null +++ b/Classwork10/S10_4/S10_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/Classwork10/S10_5/S10_5.cpp b/Classwork10/S10_5/S10_5.cpp new file mode 100644 index 0000000..bd8d96b --- /dev/null +++ b/Classwork10/S10_5/S10_5.cpp @@ -0,0 +1,22 @@ +#include +using namespace std; +int main() +{ + int a[] = { 5,26,98,77,1,27,30 }; + int b[10]; + int c = sizeof(a) / sizeof(a[0]); + for (int o = 0; o < 10; o++) + b[o] = 0; + for (int i = 0; i < c; i++) + { + int m = a[i] / 10; + int n = a[i] % 10; + if (m != 0) b[m] += 1; + b[n] += 1; + } + cout << "0 ~ 9 γ "; + for (int j = 0; j < 10; j++) + cout << b[j] << ' '; + cout << "" << endl; + return 0; +} \ No newline at end of file diff --git a/Classwork10/S10_5/S10_5.vcxproj b/Classwork10/S10_5/S10_5.vcxproj new file mode 100644 index 0000000..b048dfe --- /dev/null +++ b/Classwork10/S10_5/S10_5.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {366bb3d7-c9c9-429f-8ca6-67e6524a0d77} + S105 + 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/Classwork10/S10_5/S10_5.vcxproj.filters b/Classwork10/S10_5/S10_5.vcxproj.filters new file mode 100644 index 0000000..337e83e --- /dev/null +++ b/Classwork10/S10_5/S10_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/Classwork10/实验报告.doc b/Classwork10/实验报告.doc new file mode 100644 index 0000000..cc3cac7 Binary files /dev/null and b/Classwork10/实验报告.doc differ diff --git a/Classwork8/Classwork8.sln b/Classwork8/Classwork8.sln new file mode 100644 index 0000000..27296b6 --- /dev/null +++ b/Classwork8/Classwork8.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}") = "S8_1", "S8_1\S8_1.vcxproj", "{03768A8D-02F4-404B-8D68-D3E0DBACD390}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S8_2", "S8_2\S8_2.vcxproj", "{B99489EF-87FA-4799-9069-0D9B81D00E1F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S8_3", "S8_3\S8_3.vcxproj", "{B3EE37BB-E3BA-4E87-8201-B98A85D30B00}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S8_4", "S8_4\S8_4.vcxproj", "{53C454CD-A081-4E52-9971-64064F932BCB}" +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 + {03768A8D-02F4-404B-8D68-D3E0DBACD390}.Debug|x64.ActiveCfg = Debug|x64 + {03768A8D-02F4-404B-8D68-D3E0DBACD390}.Debug|x64.Build.0 = Debug|x64 + {03768A8D-02F4-404B-8D68-D3E0DBACD390}.Debug|x86.ActiveCfg = Debug|Win32 + {03768A8D-02F4-404B-8D68-D3E0DBACD390}.Debug|x86.Build.0 = Debug|Win32 + {03768A8D-02F4-404B-8D68-D3E0DBACD390}.Release|x64.ActiveCfg = Release|x64 + {03768A8D-02F4-404B-8D68-D3E0DBACD390}.Release|x64.Build.0 = Release|x64 + {03768A8D-02F4-404B-8D68-D3E0DBACD390}.Release|x86.ActiveCfg = Release|Win32 + {03768A8D-02F4-404B-8D68-D3E0DBACD390}.Release|x86.Build.0 = Release|Win32 + {B99489EF-87FA-4799-9069-0D9B81D00E1F}.Debug|x64.ActiveCfg = Debug|x64 + {B99489EF-87FA-4799-9069-0D9B81D00E1F}.Debug|x64.Build.0 = Debug|x64 + {B99489EF-87FA-4799-9069-0D9B81D00E1F}.Debug|x86.ActiveCfg = Debug|Win32 + {B99489EF-87FA-4799-9069-0D9B81D00E1F}.Debug|x86.Build.0 = Debug|Win32 + {B99489EF-87FA-4799-9069-0D9B81D00E1F}.Release|x64.ActiveCfg = Release|x64 + {B99489EF-87FA-4799-9069-0D9B81D00E1F}.Release|x64.Build.0 = Release|x64 + {B99489EF-87FA-4799-9069-0D9B81D00E1F}.Release|x86.ActiveCfg = Release|Win32 + {B99489EF-87FA-4799-9069-0D9B81D00E1F}.Release|x86.Build.0 = Release|Win32 + {B3EE37BB-E3BA-4E87-8201-B98A85D30B00}.Debug|x64.ActiveCfg = Debug|x64 + {B3EE37BB-E3BA-4E87-8201-B98A85D30B00}.Debug|x64.Build.0 = Debug|x64 + {B3EE37BB-E3BA-4E87-8201-B98A85D30B00}.Debug|x86.ActiveCfg = Debug|Win32 + {B3EE37BB-E3BA-4E87-8201-B98A85D30B00}.Debug|x86.Build.0 = Debug|Win32 + {B3EE37BB-E3BA-4E87-8201-B98A85D30B00}.Release|x64.ActiveCfg = Release|x64 + {B3EE37BB-E3BA-4E87-8201-B98A85D30B00}.Release|x64.Build.0 = Release|x64 + {B3EE37BB-E3BA-4E87-8201-B98A85D30B00}.Release|x86.ActiveCfg = Release|Win32 + {B3EE37BB-E3BA-4E87-8201-B98A85D30B00}.Release|x86.Build.0 = Release|Win32 + {53C454CD-A081-4E52-9971-64064F932BCB}.Debug|x64.ActiveCfg = Debug|x64 + {53C454CD-A081-4E52-9971-64064F932BCB}.Debug|x64.Build.0 = Debug|x64 + {53C454CD-A081-4E52-9971-64064F932BCB}.Debug|x86.ActiveCfg = Debug|Win32 + {53C454CD-A081-4E52-9971-64064F932BCB}.Debug|x86.Build.0 = Debug|Win32 + {53C454CD-A081-4E52-9971-64064F932BCB}.Release|x64.ActiveCfg = Release|x64 + {53C454CD-A081-4E52-9971-64064F932BCB}.Release|x64.Build.0 = Release|x64 + {53C454CD-A081-4E52-9971-64064F932BCB}.Release|x86.ActiveCfg = Release|Win32 + {53C454CD-A081-4E52-9971-64064F932BCB}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {682759F0-DA96-4CA3-9752-3F13C9815D09} + EndGlobalSection +EndGlobal diff --git a/Classwork8/S8_1/S8_1.cpp b/Classwork8/S8_1/S8_1.cpp new file mode 100644 index 0000000..c62493b --- /dev/null +++ b/Classwork8/S8_1/S8_1.cpp @@ -0,0 +1,24 @@ +#include +using namespace std; +int main() +{ + int a[6] = { 9,8,7,6,5,4 }; + int i, j, t; + int n = 6; + for (i = 0; i < n - 1; i++) + for (j = 0; j < n - i - 1; j++) + { + if (a[j] > a[j + 1]) + { + t = a[j]; + a[j] = a[j + 1]; + a[j + 1] = t; + } + } + for (i = 0; i < n; i++) + cout << a[i] << '\t'; + cout << endl; + return 0; +} + +// 4 5 6 7 8 9 \ No newline at end of file diff --git a/Classwork8/S8_1/S8_1.vcxproj b/Classwork8/S8_1/S8_1.vcxproj new file mode 100644 index 0000000..2bf9bba --- /dev/null +++ b/Classwork8/S8_1/S8_1.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {03768a8d-02f4-404b-8d68-d3e0dbacd390} + S81 + 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/Classwork8/S8_1/S8_1.vcxproj.filters b/Classwork8/S8_1/S8_1.vcxproj.filters new file mode 100644 index 0000000..fec2894 --- /dev/null +++ b/Classwork8/S8_1/S8_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/Classwork8/S8_2/S8_2.cpp b/Classwork8/S8_2/S8_2.cpp new file mode 100644 index 0000000..4797fec --- /dev/null +++ b/Classwork8/S8_2/S8_2.cpp @@ -0,0 +1,24 @@ +#include +using namespace std; +int main() +{ + int a[6] = { 9,8,7,6,5,4 }; + int i, j, min, t; + int n = 6; + for (j = 0; j < n - 1; j++) + { + min = j; + for (i = min; i < n; i++) + if (a[min] > a[i]) + min = i; + t = a[min]; + a[min] = a[j]; + a[j] = t; + } + for (i = 0; i < n; i++) + cout << a[i] << '\t'; + cout << endl; + return 0; +} + +// 4 5 6 7 8 9 \ No newline at end of file diff --git a/Classwork8/S8_2/S8_2.vcxproj b/Classwork8/S8_2/S8_2.vcxproj new file mode 100644 index 0000000..3fb8b79 --- /dev/null +++ b/Classwork8/S8_2/S8_2.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {b99489ef-87fa-4799-9069-0d9b81d00e1f} + S82 + 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/Classwork8/S8_2/S8_2.vcxproj.filters b/Classwork8/S8_2/S8_2.vcxproj.filters new file mode 100644 index 0000000..45b68cf --- /dev/null +++ b/Classwork8/S8_2/S8_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/Classwork8/S8_3/S8_3.cpp b/Classwork8/S8_3/S8_3.cpp new file mode 100644 index 0000000..33fda44 --- /dev/null +++ b/Classwork8/S8_3/S8_3.cpp @@ -0,0 +1,17 @@ +#include +using namespace std; +int main() +{ + int a[10] = { 2,5,78,4,6,3,89,12,15,34 }; + int max = 0, maxindex = 0, i; + for (i = 0; i <= 10; i++) + { + if (a[i] > max) + { + max = a[i]; + maxindex = i + 1; + } + } + cout << "max=" << max << ", maxindex=" << maxindex << endl; + return 0; +} \ No newline at end of file diff --git a/Classwork8/S8_3/S8_3.vcxproj b/Classwork8/S8_3/S8_3.vcxproj new file mode 100644 index 0000000..e7f3cc2 --- /dev/null +++ b/Classwork8/S8_3/S8_3.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {b3ee37bb-e3ba-4e87-8201-b98a85d30b00} + S83 + 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/Classwork8/S8_3/S8_3.vcxproj.filters b/Classwork8/S8_3/S8_3.vcxproj.filters new file mode 100644 index 0000000..5c3c64a --- /dev/null +++ b/Classwork8/S8_3/S8_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/Classwork8/S8_4/S8_4.cpp b/Classwork8/S8_4/S8_4.cpp new file mode 100644 index 0000000..40f3b96 --- /dev/null +++ b/Classwork8/S8_4/S8_4.cpp @@ -0,0 +1,23 @@ +#include +using namespace std; +int main() +{ + int a[100]; + int i, j, k, m; + for (i = 0; i < 100; i++) + a[i] = i; + for (j = 2; j < 100; j++) + { + for (m = 2; m < j; m++) + { + if (a[j] % m == 0) + a[j] = 0; + } + } + for (k = 0; k < 100; k++) + { + if (a[k] != 0 && a[k] != 1) + cout << a[k] << '\t'; + } + return 0; +} \ No newline at end of file diff --git a/Classwork8/S8_4/S8_4.vcxproj b/Classwork8/S8_4/S8_4.vcxproj new file mode 100644 index 0000000..66717d5 --- /dev/null +++ b/Classwork8/S8_4/S8_4.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {53c454cd-a081-4e52-9971-64064f932bcb} + S84 + 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/Classwork8/S8_4/S8_4.vcxproj.filters b/Classwork8/S8_4/S8_4.vcxproj.filters new file mode 100644 index 0000000..2db2d31 --- /dev/null +++ b/Classwork8/S8_4/S8_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/Classwork8/实验报告.doc b/Classwork8/实验报告.doc new file mode 100644 index 0000000..2a3a605 Binary files /dev/null and b/Classwork8/实验报告.doc differ diff --git a/Classwork9/Classwork9.sln b/Classwork9/Classwork9.sln new file mode 100644 index 0000000..0dbc910 --- /dev/null +++ b/Classwork9/Classwork9.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}") = "S9_1", "S9_1\S9_1.vcxproj", "{4D8BF249-14E2-440E-9F9D-94632C8DE646}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S9_2", "S9_2\S9_2.vcxproj", "{7E9B22E5-743A-4330-8C29-B8B3857413E7}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S9_3", "S9_3\S9_3.vcxproj", "{16E5D353-2098-45B5-930F-F904134542F5}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S9_4", "S9_4\S9_4.vcxproj", "{2F4FD651-70A8-4008-9B1B-53949A68ACDA}" +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 + {4D8BF249-14E2-440E-9F9D-94632C8DE646}.Debug|x64.ActiveCfg = Debug|x64 + {4D8BF249-14E2-440E-9F9D-94632C8DE646}.Debug|x64.Build.0 = Debug|x64 + {4D8BF249-14E2-440E-9F9D-94632C8DE646}.Debug|x86.ActiveCfg = Debug|Win32 + {4D8BF249-14E2-440E-9F9D-94632C8DE646}.Debug|x86.Build.0 = Debug|Win32 + {4D8BF249-14E2-440E-9F9D-94632C8DE646}.Release|x64.ActiveCfg = Release|x64 + {4D8BF249-14E2-440E-9F9D-94632C8DE646}.Release|x64.Build.0 = Release|x64 + {4D8BF249-14E2-440E-9F9D-94632C8DE646}.Release|x86.ActiveCfg = Release|Win32 + {4D8BF249-14E2-440E-9F9D-94632C8DE646}.Release|x86.Build.0 = Release|Win32 + {7E9B22E5-743A-4330-8C29-B8B3857413E7}.Debug|x64.ActiveCfg = Debug|x64 + {7E9B22E5-743A-4330-8C29-B8B3857413E7}.Debug|x64.Build.0 = Debug|x64 + {7E9B22E5-743A-4330-8C29-B8B3857413E7}.Debug|x86.ActiveCfg = Debug|Win32 + {7E9B22E5-743A-4330-8C29-B8B3857413E7}.Debug|x86.Build.0 = Debug|Win32 + {7E9B22E5-743A-4330-8C29-B8B3857413E7}.Release|x64.ActiveCfg = Release|x64 + {7E9B22E5-743A-4330-8C29-B8B3857413E7}.Release|x64.Build.0 = Release|x64 + {7E9B22E5-743A-4330-8C29-B8B3857413E7}.Release|x86.ActiveCfg = Release|Win32 + {7E9B22E5-743A-4330-8C29-B8B3857413E7}.Release|x86.Build.0 = Release|Win32 + {16E5D353-2098-45B5-930F-F904134542F5}.Debug|x64.ActiveCfg = Debug|x64 + {16E5D353-2098-45B5-930F-F904134542F5}.Debug|x64.Build.0 = Debug|x64 + {16E5D353-2098-45B5-930F-F904134542F5}.Debug|x86.ActiveCfg = Debug|Win32 + {16E5D353-2098-45B5-930F-F904134542F5}.Debug|x86.Build.0 = Debug|Win32 + {16E5D353-2098-45B5-930F-F904134542F5}.Release|x64.ActiveCfg = Release|x64 + {16E5D353-2098-45B5-930F-F904134542F5}.Release|x64.Build.0 = Release|x64 + {16E5D353-2098-45B5-930F-F904134542F5}.Release|x86.ActiveCfg = Release|Win32 + {16E5D353-2098-45B5-930F-F904134542F5}.Release|x86.Build.0 = Release|Win32 + {2F4FD651-70A8-4008-9B1B-53949A68ACDA}.Debug|x64.ActiveCfg = Debug|x64 + {2F4FD651-70A8-4008-9B1B-53949A68ACDA}.Debug|x64.Build.0 = Debug|x64 + {2F4FD651-70A8-4008-9B1B-53949A68ACDA}.Debug|x86.ActiveCfg = Debug|Win32 + {2F4FD651-70A8-4008-9B1B-53949A68ACDA}.Debug|x86.Build.0 = Debug|Win32 + {2F4FD651-70A8-4008-9B1B-53949A68ACDA}.Release|x64.ActiveCfg = Release|x64 + {2F4FD651-70A8-4008-9B1B-53949A68ACDA}.Release|x64.Build.0 = Release|x64 + {2F4FD651-70A8-4008-9B1B-53949A68ACDA}.Release|x86.ActiveCfg = Release|Win32 + {2F4FD651-70A8-4008-9B1B-53949A68ACDA}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {6EE3DC52-D26A-42BA-B948-94E0399A5B8A} + EndGlobalSection +EndGlobal diff --git a/Classwork9/S9_1/S9_1.cpp b/Classwork9/S9_1/S9_1.cpp new file mode 100644 index 0000000..189d08d --- /dev/null +++ b/Classwork9/S9_1/S9_1.cpp @@ -0,0 +1,20 @@ +#include +using namespace std; +int main() +{ + int i, j, row = 0, colum = 0, max; + int a[4][4] = { {5,12,23,56},{19,28,37,46},{-12,-34,6,8},{4,6,34,1} }; + max = a[0][0]; + for (i = 0; i < 4; i++) + for (j = 0; j < 4; j++) + if (a[i][j] > max) + { + max = a[i][j]; + row = i; + colum = j; + } + cout << "max=" << max << ",row=" << row << ",colum=" << colum << endl; + return 0; +} + +// max=56,row=0,colum=3 \ No newline at end of file diff --git a/Classwork9/S9_1/S9_1.vcxproj b/Classwork9/S9_1/S9_1.vcxproj new file mode 100644 index 0000000..66ab810 --- /dev/null +++ b/Classwork9/S9_1/S9_1.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {4d8bf249-14e2-440e-9f9d-94632c8de646} + S91 + 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/Classwork9/S9_1/S9_1.vcxproj.filters b/Classwork9/S9_1/S9_1.vcxproj.filters new file mode 100644 index 0000000..d302209 --- /dev/null +++ b/Classwork9/S9_1/S9_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/Classwork9/S9_2/S9_2.cpp b/Classwork9/S9_2/S9_2.cpp new file mode 100644 index 0000000..44bbaf2 --- /dev/null +++ b/Classwork9/S9_2/S9_2.cpp @@ -0,0 +1,38 @@ +#include +using namespace std; +int main() +{ + int a[4][4] = { {1,2,3,4},{5,6,7,8},{9,10,11,12},{13,14,15,16} }; + int i, j, t; + cout << "תǰa:\n"; + for (i = 0; i < 4; i++) + { + for (j = 0; j < 4; j++) cout << a[i][j] << '\t'; + cout << '\n'; + } + for (i = 0; i < 4; i++) + for (j = 0; j < i; j++) + { + t = a[j][i]; + a[j][i] = a[i][j]; + a[i][j] = t; + } + cout << "תúa:\n"; + for (i = 0; i < 4; i++) + { + for (j = 0; j < 4; j++) cout << a[i][j] << '\t'; + cout << '\n'; + } + return 0; +} + +// תǰa: +// 1 2 3 4 +// 5 6 7 8 +// 9 10 11 12 +// 13 14 15 16 +// תúa: +// 1 5 9 13 +// 2 6 10 14 +// 3 7 11 15 +// 4 8 12 16 \ No newline at end of file diff --git a/Classwork9/S9_2/S9_2.vcxproj b/Classwork9/S9_2/S9_2.vcxproj new file mode 100644 index 0000000..5df07d3 --- /dev/null +++ b/Classwork9/S9_2/S9_2.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {7e9b22e5-743a-4330-8c29-b8b3857413e7} + S92 + 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/Classwork9/S9_2/S9_2.vcxproj.filters b/Classwork9/S9_2/S9_2.vcxproj.filters new file mode 100644 index 0000000..1fbdf73 --- /dev/null +++ b/Classwork9/S9_2/S9_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/Classwork9/S9_3/S9_3.cpp b/Classwork9/S9_3/S9_3.cpp new file mode 100644 index 0000000..c179afa --- /dev/null +++ b/Classwork9/S9_3/S9_3.cpp @@ -0,0 +1,42 @@ +#include +using namespace std; +int prime(int num) +{ + int i; + if (num == 1) return 0; + for (i = 2; i < num; i++) + if (num % i == 0) + return 0; + return 1; + +} +int main() +{ + int a[4][4] = { {1,2,3,4},{5,6,7,8},{9,10,11,12},{13,14,15,16} }; + int i, j, n = 0; + cout << "תǰa:\n"; + for (i = 0; i < 4; i++) + { + for (j = 0; j < 4; j++) cout << a[i][j] << '\t'; + cout << '\n'; + } + for (i = 0; i < 4; i++) + for (j = i; j < 4; j++) + { + if (prime(a[i][j])==1) + { + do + a[i][j]++; + while (prime(a[i][j]) == 0); + n++; + } + } + cout << "תúa:\n"; + for (i = 0; i < 4; i++) + { + for (j = 0; j < 4; j++) cout << a[i][j] << '\t'; + cout << '\n'; + } + cout << ":" << n << endl; + return 0; +} \ No newline at end of file diff --git a/Classwork9/S9_3/S9_3.vcxproj b/Classwork9/S9_3/S9_3.vcxproj new file mode 100644 index 0000000..1612007 --- /dev/null +++ b/Classwork9/S9_3/S9_3.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {16e5d353-2098-45b5-930f-f904134542f5} + S93 + 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/Classwork9/S9_3/S9_3.vcxproj.filters b/Classwork9/S9_3/S9_3.vcxproj.filters new file mode 100644 index 0000000..2b53f35 --- /dev/null +++ b/Classwork9/S9_3/S9_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/Classwork9/S9_4/S9_4.cpp b/Classwork9/S9_4/S9_4.cpp new file mode 100644 index 0000000..4673b96 --- /dev/null +++ b/Classwork9/S9_4/S9_4.cpp @@ -0,0 +1,20 @@ +#include +using namespace std; +int main() +{ + int a[10][10] = {}; + int n, i, j; + for (n = 0; n < 10; n++) + { + a[n][0] = 1; + a[n][n] = 1; + } + for (i = 2; i < 10; i++) + for (j = 1; j < i + 1; j++) + a[i][j] = a[i - 1][j - 1] + a[i - 1][j]; + for (i = 0; i < 10; i++) + { + for (j = 0; j < i + 1; j++) cout << a[i][j] << '\t'; + cout << '\n'; + } +} \ No newline at end of file diff --git a/Classwork9/S9_4/S9_4.vcxproj b/Classwork9/S9_4/S9_4.vcxproj new file mode 100644 index 0000000..9c7502c --- /dev/null +++ b/Classwork9/S9_4/S9_4.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {2f4fd651-70a8-4008-9b1b-53949a68acda} + S94 + 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/Classwork9/S9_4/S9_4.vcxproj.filters b/Classwork9/S9_4/S9_4.vcxproj.filters new file mode 100644 index 0000000..21ac72c --- /dev/null +++ b/Classwork9/S9_4/S9_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/Classwork9/实验报告.doc b/Classwork9/实验报告.doc new file mode 100644 index 0000000..86bd9ef Binary files /dev/null and b/Classwork9/实验报告.doc differ