Bladeren bron

first commit

dut_cyh 6 maanden geleden
commit
9acc900a76
28 gewijzigde bestanden met toevoegingen van 282 en 0 verwijderingen
  1. 0 0
      README.md
  2. BIN
      homework_1/code.docx
  3. BIN
      homework_1/code.pdf
  4. BIN
      homework_1/test_2/ConsoleApplication1/.vs/ConsoleApplication1/v16/.suo
  5. BIN
      homework_1/test_2/ConsoleApplication1/.vs/ConsoleApplication1/v16/Browse.VC.db
  6. BIN
      homework_1/test_2/ConsoleApplication1/.vs/ConsoleApplication1/v16/ipch/AutoPCH/833a76ffc66082c7/CONSOLEAPPLICATION1.ipch
  7. BIN
      homework_1/test_2/ConsoleApplication1/.vs/ConsoleApplication1/v16/ipch/AutoPCH/889d5d67a061414a/CONSOLEAPPLICATION1.ipch
  8. BIN
      homework_1/test_2/ConsoleApplication1/.vs/ConsoleApplication1/v16/ipch/AutoPCH/a5f05906f490eb71/CONSOLEAPPLICATION1.ipch
  9. 31 0
      homework_1/test_2/ConsoleApplication1/ConsoleApplication1.sln
  10. 58 0
      homework_1/test_2/ConsoleApplication1/ConsoleApplication1/ConsoleApplication1.cpp
  11. 147 0
      homework_1/test_2/ConsoleApplication1/ConsoleApplication1/ConsoleApplication1.vcxproj
  12. 22 0
      homework_1/test_2/ConsoleApplication1/ConsoleApplication1/ConsoleApplication1.vcxproj.filters
  13. 4 0
      homework_1/test_2/ConsoleApplication1/ConsoleApplication1/ConsoleApplication1.vcxproj.user
  14. BIN
      homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleA.1e43a9fc.tlog/CL.command.1.tlog
  15. BIN
      homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleA.1e43a9fc.tlog/CL.read.1.tlog
  16. BIN
      homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleA.1e43a9fc.tlog/CL.write.1.tlog
  17. 2 0
      homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleA.1e43a9fc.tlog/ConsoleApplication1.lastbuildstate
  18. BIN
      homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleA.1e43a9fc.tlog/link.command.1.tlog
  19. BIN
      homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleA.1e43a9fc.tlog/link.read.1.tlog
  20. BIN
      homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleA.1e43a9fc.tlog/link.write.1.tlog
  21. 11 0
      homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleApplication1.exe.recipe
  22. BIN
      homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleApplication1.iobj
  23. BIN
      homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleApplication1.ipdb
  24. 7 0
      homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleApplication1.log
  25. BIN
      homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleApplication1.obj
  26. BIN
      homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/vc142.pdb
  27. BIN
      homework_1/test_2/ConsoleApplication1/x64/Release/ConsoleApplication1.exe
  28. BIN
      homework_1/test_2/ConsoleApplication1/x64/Release/ConsoleApplication1.pdb

+ 0 - 0
README.md


BIN
homework_1/code.docx


BIN
homework_1/code.pdf


BIN
homework_1/test_2/ConsoleApplication1/.vs/ConsoleApplication1/v16/.suo


BIN
homework_1/test_2/ConsoleApplication1/.vs/ConsoleApplication1/v16/Browse.VC.db


BIN
homework_1/test_2/ConsoleApplication1/.vs/ConsoleApplication1/v16/ipch/AutoPCH/833a76ffc66082c7/CONSOLEAPPLICATION1.ipch


BIN
homework_1/test_2/ConsoleApplication1/.vs/ConsoleApplication1/v16/ipch/AutoPCH/889d5d67a061414a/CONSOLEAPPLICATION1.ipch


BIN
homework_1/test_2/ConsoleApplication1/.vs/ConsoleApplication1/v16/ipch/AutoPCH/a5f05906f490eb71/CONSOLEAPPLICATION1.ipch


+ 31 - 0
homework_1/test_2/ConsoleApplication1/ConsoleApplication1.sln

@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.34031.81
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ConsoleApplication1", "ConsoleApplication1\ConsoleApplication1.vcxproj", "{1E43A9FC-9DEA-41B8-BBE1-4CFB45FD942B}"
+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
+		{1E43A9FC-9DEA-41B8-BBE1-4CFB45FD942B}.Debug|x64.ActiveCfg = Debug|x64
+		{1E43A9FC-9DEA-41B8-BBE1-4CFB45FD942B}.Debug|x64.Build.0 = Debug|x64
+		{1E43A9FC-9DEA-41B8-BBE1-4CFB45FD942B}.Debug|x86.ActiveCfg = Debug|Win32
+		{1E43A9FC-9DEA-41B8-BBE1-4CFB45FD942B}.Debug|x86.Build.0 = Debug|Win32
+		{1E43A9FC-9DEA-41B8-BBE1-4CFB45FD942B}.Release|x64.ActiveCfg = Release|x64
+		{1E43A9FC-9DEA-41B8-BBE1-4CFB45FD942B}.Release|x64.Build.0 = Release|x64
+		{1E43A9FC-9DEA-41B8-BBE1-4CFB45FD942B}.Release|x86.ActiveCfg = Release|Win32
+		{1E43A9FC-9DEA-41B8-BBE1-4CFB45FD942B}.Release|x86.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {06C8C522-8169-4414-A107-693D7AFC0A25}
+	EndGlobalSection
+EndGlobal

+ 58 - 0
homework_1/test_2/ConsoleApplication1/ConsoleApplication1/ConsoleApplication1.cpp

@@ -0,0 +1,58 @@
+/*HEAD homework_1_show CPP HOMEWORK */
+/*==============================================================================
+2024年度面向对象程序设计作业
+================================================================================
+File description:
+这是第一次作业演示的样板程序。
+提交者:崔宇豪
+邮箱:cyh294@mail.dlut.edu.cn
+================================================================================
+Date Name Description of Change
+05/22/2024 Cui Yuhao Created.
+05/26/2024 Cui Yuhao Added Minus function and corresponding codes.
+$HISTORY$
+================================================================================
+*/
+
+#include <iostream>   
+using namespace std;
+
+int main() {
+    const int n = 10;
+    int iNumber[n];
+    int i, j, iTempt;
+
+    srand(static_cast<unsigned int>(std::time(nullptr)));
+
+   cout << "随机数:\n";
+    for (i = 0; i < n; i++) 
+    {
+        iNumber[i] = rand() % 101;                   // 随机数范围0到100  
+        cout << iNumber[i] << " ";
+    }
+   cout << "\n";
+
+    // 冒泡排序  
+    for (i = 0; i < n - 1; i++)       //外层for循环控制排序的轮数,从数组的第一个元素开始,到倒数第二个元素结束
+    {
+        for (j = 0; j < n - i - 1; j++) //内层for循环负责在每轮排序中比较相邻的元素,如果前一个元素大于后一个元素,则交换它们的位置
+        {
+            if (iNumber[j] > iNumber[j + 1]) 
+            {
+                iTempt = iNumber[j];
+                iNumber[j] = iNumber[j + 1];
+                iNumber[j + 1] = iTempt;
+            }
+        }
+    }
+
+  
+    cout << "由小到大排序随机数:\n";   // 输出排序后的数组  
+    for (i = 0; i < n; i++)
+    {
+        cout << iNumber[i] << " ";
+    }
+    cout << "\n";
+
+    return 0;
+}

+ 147 - 0
homework_1/test_2/ConsoleApplication1/ConsoleApplication1/ConsoleApplication1.vcxproj

@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <VCProjectVersion>16.0</VCProjectVersion>
+    <Keyword>Win32Proj</Keyword>
+    <ProjectGuid>{1e43a9fc-9dea-41b8-bbe1-4cfb45fd942b}</ProjectGuid>
+    <RootNamespace>ConsoleApplication1</RootNamespace>
+    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v142</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v142</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v142</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v142</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="Shared">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <SDLCheck>true</SDLCheck>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ConformanceMode>true</ConformanceMode>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <SDLCheck>true</SDLCheck>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ConformanceMode>true</ConformanceMode>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <SDLCheck>true</SDLCheck>
+      <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ConformanceMode>true</ConformanceMode>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <SDLCheck>true</SDLCheck>
+      <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ConformanceMode>true</ConformanceMode>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="ConsoleApplication1.cpp" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>

+ 22 - 0
homework_1/test_2/ConsoleApplication1/ConsoleApplication1/ConsoleApplication1.vcxproj.filters

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="源文件">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="头文件">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
+    </Filter>
+    <Filter Include="资源文件">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="ConsoleApplication1.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+  </ItemGroup>
+</Project>

+ 4 - 0
homework_1/test_2/ConsoleApplication1/ConsoleApplication1/ConsoleApplication1.vcxproj.user

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup />
+</Project>

BIN
homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleA.1e43a9fc.tlog/CL.command.1.tlog


BIN
homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleA.1e43a9fc.tlog/CL.read.1.tlog


BIN
homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleA.1e43a9fc.tlog/CL.write.1.tlog


+ 2 - 0
homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleA.1e43a9fc.tlog/ConsoleApplication1.lastbuildstate

@@ -0,0 +1,2 @@
+PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:VCServicingVersionMFC=14.29.30136:TargetPlatformVersion=10.0.19041.0:
+Release|x64|F:\vs try\test_2\ConsoleApplication1\|

BIN
homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleA.1e43a9fc.tlog/link.command.1.tlog


BIN
homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleA.1e43a9fc.tlog/link.read.1.tlog


BIN
homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleA.1e43a9fc.tlog/link.write.1.tlog


+ 11 - 0
homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleApplication1.exe.recipe

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project>
+  <ProjectOutputs>
+    <ProjectOutput>
+      <FullPath>F:\vs try\test_2\ConsoleApplication1\x64\Release\ConsoleApplication1.exe</FullPath>
+    </ProjectOutput>
+  </ProjectOutputs>
+  <ContentFiles />
+  <SatelliteDlls />
+  <NonRecipeFileRefs />
+</Project>

BIN
homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleApplication1.iobj


BIN
homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleApplication1.ipdb


+ 7 - 0
homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleApplication1.log

@@ -0,0 +1,7 @@
+  ConsoleApplication1.cpp
+  正在生成代码
+  0 of 11 functions ( 0.0%) were compiled, the rest were copied from previous compilation.
+    0 functions were new in current compilation
+    0 functions had inline decision re-evaluated but remain unchanged
+  已完成代码的生成
+  ConsoleApplication1.vcxproj -> F:\vs try\test_2\ConsoleApplication1\x64\Release\ConsoleApplication1.exe

BIN
homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/ConsoleApplication1.obj


BIN
homework_1/test_2/ConsoleApplication1/ConsoleApplication1/x64/Release/vc142.pdb


BIN
homework_1/test_2/ConsoleApplication1/x64/Release/ConsoleApplication1.exe


BIN
homework_1/test_2/ConsoleApplication1/x64/Release/ConsoleApplication1.pdb