diff --git a/Classwork11/Classwork11.sln b/Classwork11/Classwork11.sln new file mode 100644 index 0000000..ca25f0f --- /dev/null +++ b/Classwork11/Classwork11.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}") = "S11_1", "S11_1\S11_1.vcxproj", "{3CBC179A-700C-40E5-9877-6448243768F2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S11_2", "S11_2\S11_2.vcxproj", "{D6EC8107-4E04-442E-A291-A68524C0DBB2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S11_3", "S11_3\S11_3.vcxproj", "{A8387AF8-9B12-4950-9DAB-C071A4E24659}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S11_4", "S11_4\S11_4.vcxproj", "{2AC6A7CA-B3F7-4D3F-8750-9B51B0D62526}" +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 + {3CBC179A-700C-40E5-9877-6448243768F2}.Debug|x64.ActiveCfg = Debug|x64 + {3CBC179A-700C-40E5-9877-6448243768F2}.Debug|x64.Build.0 = Debug|x64 + {3CBC179A-700C-40E5-9877-6448243768F2}.Debug|x86.ActiveCfg = Debug|Win32 + {3CBC179A-700C-40E5-9877-6448243768F2}.Debug|x86.Build.0 = Debug|Win32 + {3CBC179A-700C-40E5-9877-6448243768F2}.Release|x64.ActiveCfg = Release|x64 + {3CBC179A-700C-40E5-9877-6448243768F2}.Release|x64.Build.0 = Release|x64 + {3CBC179A-700C-40E5-9877-6448243768F2}.Release|x86.ActiveCfg = Release|Win32 + {3CBC179A-700C-40E5-9877-6448243768F2}.Release|x86.Build.0 = Release|Win32 + {D6EC8107-4E04-442E-A291-A68524C0DBB2}.Debug|x64.ActiveCfg = Debug|x64 + {D6EC8107-4E04-442E-A291-A68524C0DBB2}.Debug|x64.Build.0 = Debug|x64 + {D6EC8107-4E04-442E-A291-A68524C0DBB2}.Debug|x86.ActiveCfg = Debug|Win32 + {D6EC8107-4E04-442E-A291-A68524C0DBB2}.Debug|x86.Build.0 = Debug|Win32 + {D6EC8107-4E04-442E-A291-A68524C0DBB2}.Release|x64.ActiveCfg = Release|x64 + {D6EC8107-4E04-442E-A291-A68524C0DBB2}.Release|x64.Build.0 = Release|x64 + {D6EC8107-4E04-442E-A291-A68524C0DBB2}.Release|x86.ActiveCfg = Release|Win32 + {D6EC8107-4E04-442E-A291-A68524C0DBB2}.Release|x86.Build.0 = Release|Win32 + {A8387AF8-9B12-4950-9DAB-C071A4E24659}.Debug|x64.ActiveCfg = Debug|x64 + {A8387AF8-9B12-4950-9DAB-C071A4E24659}.Debug|x64.Build.0 = Debug|x64 + {A8387AF8-9B12-4950-9DAB-C071A4E24659}.Debug|x86.ActiveCfg = Debug|Win32 + {A8387AF8-9B12-4950-9DAB-C071A4E24659}.Debug|x86.Build.0 = Debug|Win32 + {A8387AF8-9B12-4950-9DAB-C071A4E24659}.Release|x64.ActiveCfg = Release|x64 + {A8387AF8-9B12-4950-9DAB-C071A4E24659}.Release|x64.Build.0 = Release|x64 + {A8387AF8-9B12-4950-9DAB-C071A4E24659}.Release|x86.ActiveCfg = Release|Win32 + {A8387AF8-9B12-4950-9DAB-C071A4E24659}.Release|x86.Build.0 = Release|Win32 + {2AC6A7CA-B3F7-4D3F-8750-9B51B0D62526}.Debug|x64.ActiveCfg = Debug|x64 + {2AC6A7CA-B3F7-4D3F-8750-9B51B0D62526}.Debug|x64.Build.0 = Debug|x64 + {2AC6A7CA-B3F7-4D3F-8750-9B51B0D62526}.Debug|x86.ActiveCfg = Debug|Win32 + {2AC6A7CA-B3F7-4D3F-8750-9B51B0D62526}.Debug|x86.Build.0 = Debug|Win32 + {2AC6A7CA-B3F7-4D3F-8750-9B51B0D62526}.Release|x64.ActiveCfg = Release|x64 + {2AC6A7CA-B3F7-4D3F-8750-9B51B0D62526}.Release|x64.Build.0 = Release|x64 + {2AC6A7CA-B3F7-4D3F-8750-9B51B0D62526}.Release|x86.ActiveCfg = Release|Win32 + {2AC6A7CA-B3F7-4D3F-8750-9B51B0D62526}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1D497C1D-2B35-4177-B869-F49BFCC81ACA} + EndGlobalSection +EndGlobal diff --git a/Classwork11/S11_1/S11_1.cpp b/Classwork11/S11_1/S11_1.cpp new file mode 100644 index 0000000..3936625 --- /dev/null +++ b/Classwork11/S11_1/S11_1.cpp @@ -0,0 +1,17 @@ +#include +using namespace std; +int main() +{ + char s[200]; + cout << "һַ:\n"; + cin.getline(s, 200); + int a = 0, b = 0, c = 0; + for (int i = 0; s[i] != '\0'; i++) + { + if (s[i] >= 'A' && s[i] <= 'Z') a++; + else if (s[i] >= 'a' && s[i] <= 'z') b++; + else if (s[i] >= '0' && s[i] <= '9') c++; + } + cout << "дַ:" << a << '\t' << "Сдַ:" << b << '\t' << "ַ:" << c << endl; + return 0; +} \ No newline at end of file diff --git a/Classwork11/S11_1/S11_1.vcxproj b/Classwork11/S11_1/S11_1.vcxproj new file mode 100644 index 0000000..7cfc627 --- /dev/null +++ b/Classwork11/S11_1/S11_1.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {3cbc179a-700c-40e5-9877-6448243768f2} + S111 + 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/Classwork11/S11_1/S11_1.vcxproj.filters b/Classwork11/S11_1/S11_1.vcxproj.filters new file mode 100644 index 0000000..0397ee4 --- /dev/null +++ b/Classwork11/S11_1/S11_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/Classwork11/S11_2/S11_2.cpp b/Classwork11/S11_2/S11_2.cpp new file mode 100644 index 0000000..5025e6f --- /dev/null +++ b/Classwork11/S11_2/S11_2.cpp @@ -0,0 +1,25 @@ +#include +#include +using namespace std; +int main() +{ + char str[100]; + int flag = 0; + cout << "Input a string:\n"; + cin.getline(str, 100); + for (int i = 0; str[i] != '\0'; i++) + { + if (str[i] >= 'a' && str[i] <= 'z' && flag == 0) + { + str[i] = str[i] - 0x20; + flag = 1; + } + if (str[i] == ' ' || str[i] == '\n') + flag = 0; + } + cout << "the result is:\n"; + cout << str << endl; + return 0; +} + +// I am a student. -> I Am A Student. \ No newline at end of file diff --git a/Classwork11/S11_2/S11_2.vcxproj b/Classwork11/S11_2/S11_2.vcxproj new file mode 100644 index 0000000..32c2554 --- /dev/null +++ b/Classwork11/S11_2/S11_2.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {d6ec8107-4e04-442e-a291-a68524c0dbb2} + S112 + 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/Classwork11/S11_2/S11_2.vcxproj.filters b/Classwork11/S11_2/S11_2.vcxproj.filters new file mode 100644 index 0000000..09922a5 --- /dev/null +++ b/Classwork11/S11_2/S11_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/Classwork11/S11_3/S11_3.cpp b/Classwork11/S11_3/S11_3.cpp new file mode 100644 index 0000000..d97acc3 --- /dev/null +++ b/Classwork11/S11_3/S11_3.cpp @@ -0,0 +1,22 @@ +#include +using namespace std; +int main() +{ + char a[25565]; + cin.getline(a, 25565); + int b = 0, flag = 0; + for (int i = 0; a[i] != '\0'; i++) + { + { + if (((a[i] >= 0x41 && a[i] <= 0x5A) || (a[i] >= 0x61 && a[i] <= 0x7A)) && flag == 0) + { + b++; + flag = 1; + } + if (a[i] == 0x20 || a[i] == 0x21 || a[i] == 0x2c || a[i] == 0x2e || a[i] == 0x3a || a[i] == 0x3b || a[i] == 0x3f) + flag = 0; + } + } + cout << b << " words" << endl; + return 0; +} \ No newline at end of file diff --git a/Classwork11/S11_3/S11_3.vcxproj b/Classwork11/S11_3/S11_3.vcxproj new file mode 100644 index 0000000..9ee5b40 --- /dev/null +++ b/Classwork11/S11_3/S11_3.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {a8387af8-9b12-4950-9dab-c071a4e24659} + S113 + 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/Classwork11/S11_3/S11_3.vcxproj.filters b/Classwork11/S11_3/S11_3.vcxproj.filters new file mode 100644 index 0000000..c274b0f --- /dev/null +++ b/Classwork11/S11_3/S11_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/Classwork11/S11_4/S11_4.cpp b/Classwork11/S11_4/S11_4.cpp new file mode 100644 index 0000000..a74529a --- /dev/null +++ b/Classwork11/S11_4/S11_4.cpp @@ -0,0 +1,31 @@ +#include +using namespace std; +bool isLetter(char in) +{ + if ((in >= 0x41 && in <= 0x5A) || (in >= 0x61 && in <= 0x7A)) return true; + else return false; +} +int main() +{ + char longest_word[100], string[25565]; + int length = 0, length_temp, begin; + cin.getline(string, 25565); + for (int i = 0; string[i] != '\0'; i++) + if (isLetter(string[i]) == true) + { + begin = i; + do i++; while (isLetter(string[i]) == true); + length_temp = i - begin; + if (length_temp > length) + { + length = length_temp; + for (int j = 0; j < length; j++) + longest_word[j] = string[begin + j]; + } + } + cout << "The longest word is "; + for (int k = 0; k < length; k++) + cout << longest_word[k]; + cout << endl; + return 0; +} \ No newline at end of file diff --git a/Classwork11/S11_4/S11_4.vcxproj b/Classwork11/S11_4/S11_4.vcxproj new file mode 100644 index 0000000..d449bc8 --- /dev/null +++ b/Classwork11/S11_4/S11_4.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {2ac6a7ca-b3f7-4d3f-8750-9b51b0d62526} + S114 + 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/Classwork11/S11_4/S11_4.vcxproj.filters b/Classwork11/S11_4/S11_4.vcxproj.filters new file mode 100644 index 0000000..81724a1 --- /dev/null +++ b/Classwork11/S11_4/S11_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/Classwork11/实验报告.doc b/Classwork11/实验报告.doc new file mode 100644 index 0000000..b6bb431 Binary files /dev/null and b/Classwork11/实验报告.doc differ diff --git a/Classwork12/Classwork12.sln b/Classwork12/Classwork12.sln new file mode 100644 index 0000000..55813d4 --- /dev/null +++ b/Classwork12/Classwork12.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}") = "S12_1", "S12_1\S12_1.vcxproj", "{D9DB840E-71A9-4C78-A9A6-0E6BC61487C2}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S12_2", "S12_2\S12_2.vcxproj", "{FF7EB25A-6417-4E86-8247-4394FCE8DB4A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S12_3", "S12_3\S12_3.vcxproj", "{974536A7-B432-4057-9F4A-2287F46C3DCF}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S12_4", "S12_4\S12_4.vcxproj", "{3AE939D3-147A-42AE-A5E7-55A19896A977}" +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 + {D9DB840E-71A9-4C78-A9A6-0E6BC61487C2}.Debug|x64.ActiveCfg = Debug|x64 + {D9DB840E-71A9-4C78-A9A6-0E6BC61487C2}.Debug|x64.Build.0 = Debug|x64 + {D9DB840E-71A9-4C78-A9A6-0E6BC61487C2}.Debug|x86.ActiveCfg = Debug|Win32 + {D9DB840E-71A9-4C78-A9A6-0E6BC61487C2}.Debug|x86.Build.0 = Debug|Win32 + {D9DB840E-71A9-4C78-A9A6-0E6BC61487C2}.Release|x64.ActiveCfg = Release|x64 + {D9DB840E-71A9-4C78-A9A6-0E6BC61487C2}.Release|x64.Build.0 = Release|x64 + {D9DB840E-71A9-4C78-A9A6-0E6BC61487C2}.Release|x86.ActiveCfg = Release|Win32 + {D9DB840E-71A9-4C78-A9A6-0E6BC61487C2}.Release|x86.Build.0 = Release|Win32 + {FF7EB25A-6417-4E86-8247-4394FCE8DB4A}.Debug|x64.ActiveCfg = Debug|x64 + {FF7EB25A-6417-4E86-8247-4394FCE8DB4A}.Debug|x64.Build.0 = Debug|x64 + {FF7EB25A-6417-4E86-8247-4394FCE8DB4A}.Debug|x86.ActiveCfg = Debug|Win32 + {FF7EB25A-6417-4E86-8247-4394FCE8DB4A}.Debug|x86.Build.0 = Debug|Win32 + {FF7EB25A-6417-4E86-8247-4394FCE8DB4A}.Release|x64.ActiveCfg = Release|x64 + {FF7EB25A-6417-4E86-8247-4394FCE8DB4A}.Release|x64.Build.0 = Release|x64 + {FF7EB25A-6417-4E86-8247-4394FCE8DB4A}.Release|x86.ActiveCfg = Release|Win32 + {FF7EB25A-6417-4E86-8247-4394FCE8DB4A}.Release|x86.Build.0 = Release|Win32 + {974536A7-B432-4057-9F4A-2287F46C3DCF}.Debug|x64.ActiveCfg = Debug|x64 + {974536A7-B432-4057-9F4A-2287F46C3DCF}.Debug|x64.Build.0 = Debug|x64 + {974536A7-B432-4057-9F4A-2287F46C3DCF}.Debug|x86.ActiveCfg = Debug|Win32 + {974536A7-B432-4057-9F4A-2287F46C3DCF}.Debug|x86.Build.0 = Debug|Win32 + {974536A7-B432-4057-9F4A-2287F46C3DCF}.Release|x64.ActiveCfg = Release|x64 + {974536A7-B432-4057-9F4A-2287F46C3DCF}.Release|x64.Build.0 = Release|x64 + {974536A7-B432-4057-9F4A-2287F46C3DCF}.Release|x86.ActiveCfg = Release|Win32 + {974536A7-B432-4057-9F4A-2287F46C3DCF}.Release|x86.Build.0 = Release|Win32 + {3AE939D3-147A-42AE-A5E7-55A19896A977}.Debug|x64.ActiveCfg = Debug|x64 + {3AE939D3-147A-42AE-A5E7-55A19896A977}.Debug|x64.Build.0 = Debug|x64 + {3AE939D3-147A-42AE-A5E7-55A19896A977}.Debug|x86.ActiveCfg = Debug|Win32 + {3AE939D3-147A-42AE-A5E7-55A19896A977}.Debug|x86.Build.0 = Debug|Win32 + {3AE939D3-147A-42AE-A5E7-55A19896A977}.Release|x64.ActiveCfg = Release|x64 + {3AE939D3-147A-42AE-A5E7-55A19896A977}.Release|x64.Build.0 = Release|x64 + {3AE939D3-147A-42AE-A5E7-55A19896A977}.Release|x86.ActiveCfg = Release|Win32 + {3AE939D3-147A-42AE-A5E7-55A19896A977}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {DD92283B-2978-4583-AB2D-C8033E54A6E3} + EndGlobalSection +EndGlobal diff --git a/Classwork12/S12_1/S12_1.cpp b/Classwork12/S12_1/S12_1.cpp new file mode 100644 index 0000000..86d7314 --- /dev/null +++ b/Classwork12/S12_1/S12_1.cpp @@ -0,0 +1,28 @@ +#include +using namespace std; +void fun(int* w, int p, int n) +{ + int t, i, j; + for (i = 0; i <= p; i++) + { + t = *w; + for (j = 0; j < n - 1; j++) + *(w + j) = *(w + j + 1); + *(w + j) = t; + } +} +int main() +{ + int a[] = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 }; + int p; + cout << "Input p:"; + cin >> p; + int n = sizeof(a) / sizeof(int); + fun(a, p, n); + for (int i = 0; i < n; i++) + cout << a[i] << '\t'; + cout << endl; + return 0; +} + +// 4 -> 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 \ No newline at end of file diff --git a/Classwork12/S12_1/S12_1.vcxproj b/Classwork12/S12_1/S12_1.vcxproj new file mode 100644 index 0000000..d0b8c6f --- /dev/null +++ b/Classwork12/S12_1/S12_1.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {d9db840e-71a9-4c78-a9a6-0e6bc61487c2} + S121 + 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/Classwork12/S12_1/S12_1.vcxproj.filters b/Classwork12/S12_1/S12_1.vcxproj.filters new file mode 100644 index 0000000..d3e6416 --- /dev/null +++ b/Classwork12/S12_1/S12_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/Classwork12/S12_2/S12_2.cpp b/Classwork12/S12_2/S12_2.cpp new file mode 100644 index 0000000..33e8789 --- /dev/null +++ b/Classwork12/S12_2/S12_2.cpp @@ -0,0 +1,40 @@ +#include +#include +using namespace std; +double f1(double x) +{ + return 1.0 / (2 + sin(x)); +} +double f2(double x) +{ + return 1.0 / (2 - cos(x)); +} +double f3(double x) +{ + return (1 + x) / (1 + x * x); +} +double integral(double (*pf)(double), int n, double a, double b) +{ + double h; + h = (b - a) / n; + double result; + result = (pf(a) + pf(b)) / 2; + for (int i = 1; i < n; i++) + result = result + pf(a + i * h) + pf(a + (i + 1) * h); + result = result * h; + return result; +} +int main(void) +{ + cout << "f1(x):" << '\t'; + cout << "n = 1000 " << integral(f1, 1000, 1.0, 2.0) << endl; + cout << "f2(x):" << '\t'; + cout << "n = 2000 " << integral(f2, 2000, 2.0, 3.0) << endl; + cout << "f3(x):" << '\t'; + cout << "n = 3000 " << integral(f3, 3000, 2.0, 4.0) << endl; + return 0; +} + +// f1(x) : n = 1000 0.676267 +// f2(x) : n = 2000 0.725125 +// f3(x) : n = 3000 1.66061 \ No newline at end of file diff --git a/Classwork12/S12_2/S12_2.vcxproj b/Classwork12/S12_2/S12_2.vcxproj new file mode 100644 index 0000000..ec12b2d --- /dev/null +++ b/Classwork12/S12_2/S12_2.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {ff7eb25a-6417-4e86-8247-4394fce8db4a} + S122 + 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/Classwork12/S12_2/S12_2.vcxproj.filters b/Classwork12/S12_2/S12_2.vcxproj.filters new file mode 100644 index 0000000..88e7cf1 --- /dev/null +++ b/Classwork12/S12_2/S12_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/Classwork12/S12_3/S12_3.cpp b/Classwork12/S12_3/S12_3.cpp new file mode 100644 index 0000000..be6dc04 --- /dev/null +++ b/Classwork12/S12_3/S12_3.cpp @@ -0,0 +1,32 @@ +#include +#include +using namespace std; +int main() +{ + int a[16] = { 55 }; + for (int i = 1; i < 16; i++) + *(a + i) = (15 * (*(a + i - 1)) + 97) % 256; + cout << "aԪΪ" << endl; + for (int i = 0; i < 16; i++) + cout << *(a + i) << "\t"; + double average = 0; + for (int i = 0; i < 16; i++) + average += *(a + i); + average /= 16; + cout << "\nƽֵ = " << average << endl; + int max = average, num; + for (int i = 0; i < 16; i++) + if (abs(*(a + i) - average) > abs(max - average)) + { + max = *(a + i); + num = i; + } + cout << "ֵ = " << max << endl; + cout << "ɾ" << max << "Ԫأ" << endl; + for (int i = 0; i < 16; i++) + { + if (i == num) + continue; + cout << *(a + i) << "\t"; + } +} \ No newline at end of file diff --git a/Classwork12/S12_3/S12_3.vcxproj b/Classwork12/S12_3/S12_3.vcxproj new file mode 100644 index 0000000..ac2b76e --- /dev/null +++ b/Classwork12/S12_3/S12_3.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {974536a7-b432-4057-9f4a-2287f46c3dcf} + S123 + 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/Classwork12/S12_3/S12_3.vcxproj.filters b/Classwork12/S12_3/S12_3.vcxproj.filters new file mode 100644 index 0000000..0c767bb --- /dev/null +++ b/Classwork12/S12_3/S12_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/Classwork12/S12_4/S12_4.cpp b/Classwork12/S12_4/S12_4.cpp new file mode 100644 index 0000000..d75adc7 --- /dev/null +++ b/Classwork12/S12_4/S12_4.cpp @@ -0,0 +1,37 @@ +#include +using namespace std; +double average(int(*p1)[4], int* p2) +{ + double sum = 0; + for (int i = 0; i < *p2; i++) + for (int j = 0; j < 4; j++) + sum += p1[i][j]; + return sum / ((*p2) * 4); +} +int max(int(*p1)[4], int* p2) +{ + int max = 0; + for (int i = 0; i < *p2; i++) + for (int j = 0; j < 4; j++) + if (p1[i][j] > max) + max = p1[i][j]; + return max; +} +int min(int(*p1)[4], int* p2) +{ + int min = 100; + for (int i = 0; i < *p2; i++) + for (int j = 0; j < 4; j++) + if (p1[i][j] < min) + min = p1[i][j]; + return min; +} +int main() +{ + int a[3][4] = { {2,3,4,5},{12,13,14,15},{1,2,3,4} }; + int r = 3; + cout << "ave=" << average(a, &r) << '\t'; + cout << "max=" << max(a, &r) << '\t'; + cout << "min=" << min(a, &r) << endl; + return 0; +} \ No newline at end of file diff --git a/Classwork12/S12_4/S12_4.vcxproj b/Classwork12/S12_4/S12_4.vcxproj new file mode 100644 index 0000000..9a72a77 --- /dev/null +++ b/Classwork12/S12_4/S12_4.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {3ae939d3-147a-42ae-a5e7-55a19896a977} + S124 + 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/Classwork12/S12_4/S12_4.vcxproj.filters b/Classwork12/S12_4/S12_4.vcxproj.filters new file mode 100644 index 0000000..67c1f5f --- /dev/null +++ b/Classwork12/S12_4/S12_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/Classwork12/实验报告.doc b/Classwork12/实验报告.doc new file mode 100644 index 0000000..1ece73d Binary files /dev/null and b/Classwork12/实验报告.doc differ diff --git a/Classwork13/Classwork13.sln b/Classwork13/Classwork13.sln new file mode 100644 index 0000000..c0124d6 --- /dev/null +++ b/Classwork13/Classwork13.sln @@ -0,0 +1,61 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34322.80 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S13_1", "S13_1\S13_1.vcxproj", "{ADBB0BF0-B5FC-4929-B541-DC37E1509405}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S13_2", "S13_2\S13_2.vcxproj", "{EAF98BCE-2027-47BC-88EF-2F095C6B6261}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S13_3", "S13_3\S13_3.vcxproj", "{07B19D78-4734-45A4-A84E-DBE3D2E8F7D9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "S13_4", "S13_4\S13_4.vcxproj", "{69B88FED-DCFB-4100-B4C0-FDAF59178E1F}" +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 + {ADBB0BF0-B5FC-4929-B541-DC37E1509405}.Debug|x64.ActiveCfg = Debug|x64 + {ADBB0BF0-B5FC-4929-B541-DC37E1509405}.Debug|x64.Build.0 = Debug|x64 + {ADBB0BF0-B5FC-4929-B541-DC37E1509405}.Debug|x86.ActiveCfg = Debug|Win32 + {ADBB0BF0-B5FC-4929-B541-DC37E1509405}.Debug|x86.Build.0 = Debug|Win32 + {ADBB0BF0-B5FC-4929-B541-DC37E1509405}.Release|x64.ActiveCfg = Release|x64 + {ADBB0BF0-B5FC-4929-B541-DC37E1509405}.Release|x64.Build.0 = Release|x64 + {ADBB0BF0-B5FC-4929-B541-DC37E1509405}.Release|x86.ActiveCfg = Release|Win32 + {ADBB0BF0-B5FC-4929-B541-DC37E1509405}.Release|x86.Build.0 = Release|Win32 + {EAF98BCE-2027-47BC-88EF-2F095C6B6261}.Debug|x64.ActiveCfg = Debug|x64 + {EAF98BCE-2027-47BC-88EF-2F095C6B6261}.Debug|x64.Build.0 = Debug|x64 + {EAF98BCE-2027-47BC-88EF-2F095C6B6261}.Debug|x86.ActiveCfg = Debug|Win32 + {EAF98BCE-2027-47BC-88EF-2F095C6B6261}.Debug|x86.Build.0 = Debug|Win32 + {EAF98BCE-2027-47BC-88EF-2F095C6B6261}.Release|x64.ActiveCfg = Release|x64 + {EAF98BCE-2027-47BC-88EF-2F095C6B6261}.Release|x64.Build.0 = Release|x64 + {EAF98BCE-2027-47BC-88EF-2F095C6B6261}.Release|x86.ActiveCfg = Release|Win32 + {EAF98BCE-2027-47BC-88EF-2F095C6B6261}.Release|x86.Build.0 = Release|Win32 + {07B19D78-4734-45A4-A84E-DBE3D2E8F7D9}.Debug|x64.ActiveCfg = Debug|x64 + {07B19D78-4734-45A4-A84E-DBE3D2E8F7D9}.Debug|x64.Build.0 = Debug|x64 + {07B19D78-4734-45A4-A84E-DBE3D2E8F7D9}.Debug|x86.ActiveCfg = Debug|Win32 + {07B19D78-4734-45A4-A84E-DBE3D2E8F7D9}.Debug|x86.Build.0 = Debug|Win32 + {07B19D78-4734-45A4-A84E-DBE3D2E8F7D9}.Release|x64.ActiveCfg = Release|x64 + {07B19D78-4734-45A4-A84E-DBE3D2E8F7D9}.Release|x64.Build.0 = Release|x64 + {07B19D78-4734-45A4-A84E-DBE3D2E8F7D9}.Release|x86.ActiveCfg = Release|Win32 + {07B19D78-4734-45A4-A84E-DBE3D2E8F7D9}.Release|x86.Build.0 = Release|Win32 + {69B88FED-DCFB-4100-B4C0-FDAF59178E1F}.Debug|x64.ActiveCfg = Debug|x64 + {69B88FED-DCFB-4100-B4C0-FDAF59178E1F}.Debug|x64.Build.0 = Debug|x64 + {69B88FED-DCFB-4100-B4C0-FDAF59178E1F}.Debug|x86.ActiveCfg = Debug|Win32 + {69B88FED-DCFB-4100-B4C0-FDAF59178E1F}.Debug|x86.Build.0 = Debug|Win32 + {69B88FED-DCFB-4100-B4C0-FDAF59178E1F}.Release|x64.ActiveCfg = Release|x64 + {69B88FED-DCFB-4100-B4C0-FDAF59178E1F}.Release|x64.Build.0 = Release|x64 + {69B88FED-DCFB-4100-B4C0-FDAF59178E1F}.Release|x86.ActiveCfg = Release|Win32 + {69B88FED-DCFB-4100-B4C0-FDAF59178E1F}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A901411F-956D-4D6C-8988-DEA5A6AEA8C4} + EndGlobalSection +EndGlobal diff --git a/Classwork13/S13_1/S13_1.cpp b/Classwork13/S13_1/S13_1.cpp new file mode 100644 index 0000000..2e2130f --- /dev/null +++ b/Classwork13/S13_1/S13_1.cpp @@ -0,0 +1,19 @@ +#include +#include +using namespace std; +int main() +{ + char str[100]; + cout << "һַ:"; + cin.getline(str, 100); + int i = 0, s = 0; + while (str[i]) + { + s = s * 10 + str[i] - '0'; + i++; + } + cout << s << endl; + return 0; +} + +// 1234 -> 1234 \ No newline at end of file diff --git a/Classwork13/S13_1/S13_1.vcxproj b/Classwork13/S13_1/S13_1.vcxproj new file mode 100644 index 0000000..6d4b8eb --- /dev/null +++ b/Classwork13/S13_1/S13_1.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {adbb0bf0-b5fc-4929-b541-dc37e1509405} + S131 + 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/Classwork13/S13_1/S13_1.vcxproj.filters b/Classwork13/S13_1/S13_1.vcxproj.filters new file mode 100644 index 0000000..0d07511 --- /dev/null +++ b/Classwork13/S13_1/S13_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/Classwork13/S13_2/S13_2.cpp b/Classwork13/S13_2/S13_2.cpp new file mode 100644 index 0000000..19e30f3 --- /dev/null +++ b/Classwork13/S13_2/S13_2.cpp @@ -0,0 +1,45 @@ +#include +#include +using namespace std; +void fun1(char* s, int n, int r) +{ + int i = 0, t; + while (n) + { + t = n % r; + if (t >= 10) + s[i++] = t - 10 + 'A'; + else + s[i++] = t + '0'; + n = n / r; + } + s[i] = '\0'; +} +void fun2(char* s) +{ + char ch; + int len = strlen(s); + for (int i = 0; i < len / 2; i++) + { + ch = s[i]; + s[i] = s[len - i - 1]; + s[len - i - 1] = ch; + } +} +int main() +{ + char s[200]; + int n, r; + cout << "תʮ:"; + cin >> n; + cout << "뽫ʮ" << n << "תɶٽƵ"; + cin >> r; + fun1(s, n, r); + fun2(s); + cout << "ʮ" << n << "ת" << r << "ƵΪ:" << s << endl; + return 0; +} + +// 123 2 -> 1111011 +// 123 8 -> 173 +// 123 16 -> 7B \ No newline at end of file diff --git a/Classwork13/S13_2/S13_2.vcxproj b/Classwork13/S13_2/S13_2.vcxproj new file mode 100644 index 0000000..46739e1 --- /dev/null +++ b/Classwork13/S13_2/S13_2.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {eaf98bce-2027-47bc-88ef-2f095c6b6261} + S132 + 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/Classwork13/S13_2/S13_2.vcxproj.filters b/Classwork13/S13_2/S13_2.vcxproj.filters new file mode 100644 index 0000000..ef0dbda --- /dev/null +++ b/Classwork13/S13_2/S13_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/Classwork13/S13_3/S13_3.cpp b/Classwork13/S13_3/S13_3.cpp new file mode 100644 index 0000000..7b14892 --- /dev/null +++ b/Classwork13/S13_3/S13_3.cpp @@ -0,0 +1,33 @@ +#include +#include +using namespace std; +int getInt(char* input, int* output) +{ + int count = 0; + while (*input) + { + if (isdigit(*input)) + { + char* start = input; + while (isdigit(*input)) + input++; + output[count++] = stoi(string(start, input)); + } + else + input++; + } + return count; +} +int main() +{ + char str[25565]; + int number[25565]; + cout << "һַ:"; + cin.getline(str, 25565); + int count = getInt(str, number); + cout << "ȡΪ:" << count << endl; + cout << "ֱΪ: "; + for (int i = 0; i < count; i++) + cout << number[i] << " "; + return 0; +} \ No newline at end of file diff --git a/Classwork13/S13_3/S13_3.vcxproj b/Classwork13/S13_3/S13_3.vcxproj new file mode 100644 index 0000000..dca035e --- /dev/null +++ b/Classwork13/S13_3/S13_3.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {07b19d78-4734-45a4-a84e-dbe3d2e8f7d9} + S133 + 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/Classwork13/S13_3/S13_3.vcxproj.filters b/Classwork13/S13_3/S13_3.vcxproj.filters new file mode 100644 index 0000000..725213e --- /dev/null +++ b/Classwork13/S13_3/S13_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/Classwork13/S13_4/S13_4.cpp b/Classwork13/S13_4/S13_4.cpp new file mode 100644 index 0000000..ca2a740 --- /dev/null +++ b/Classwork13/S13_4/S13_4.cpp @@ -0,0 +1,29 @@ +#include +#include +using namespace std; +int fun(char* str, char* substr) +{ + int count = 0, substr_len = strlen(substr); + while (*str) + { + if (strncmp(str, substr, substr_len) == 0) + { + count++; + str += substr_len; + } + else + str++; + } + return count; +} +int main() +{ + char string[25565], substring[25565]; + cout << "ĸַ:"; + cin.getline(string, 25565); + cout << "ַ:"; + cin.getline(substring, 25565); + int count = fun(string, substring); + cout << "ַ\"" << substring << "\"ĸַ\"" << string << "\"гֵĴΪ:" << count << endl; + return 0; +} \ No newline at end of file diff --git a/Classwork13/S13_4/S13_4.vcxproj b/Classwork13/S13_4/S13_4.vcxproj new file mode 100644 index 0000000..ee9661e --- /dev/null +++ b/Classwork13/S13_4/S13_4.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {69b88fed-dcfb-4100-b4c0-fdaf59178e1f} + S134 + 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/Classwork13/S13_4/S13_4.vcxproj.filters b/Classwork13/S13_4/S13_4.vcxproj.filters new file mode 100644 index 0000000..c898bba --- /dev/null +++ b/Classwork13/S13_4/S13_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/Classwork13/实验报告.doc b/Classwork13/实验报告.doc new file mode 100644 index 0000000..a2b8121 Binary files /dev/null and b/Classwork13/实验报告.doc differ