2023-10-19

This commit is contained in:
2023-10-19 11:48:05 +08:00
commit 121d4a1c90
56 changed files with 2958 additions and 0 deletions

10
homework231008/.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,10 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# CodeStream ignored files
/../../homework231008\.idea/codestream.xml

7
homework231008/.idea/codestream.xml generated Normal file
View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CodeStream">
<option name="teamId" value="6512335c1eb5d01756fa399a" />
<option name="webViewContext" value="{&quot;chatProviderAccess&quot;:&quot;strict&quot;,&quot;currentTeamId&quot;:&quot;6512335c1eb5d01756fa399a&quot;,&quot;currentStreamId&quot;:&quot;&quot;,&quot;pullRequestCheckoutBranch&quot;:false,&quot;isRepositioning&quot;:false,&quot;onboardStep&quot;:0,&quot;panelStack&quot;:[&quot;landing-redirect&quot;],&quot;hasFocus&quot;:false,&quot;channelFilter&quot;:&quot;all&quot;,&quot;channelsMuteAll&quot;:false,&quot;codemarkFileFilter&quot;:&quot;all&quot;,&quot;codemarkTypeFilter&quot;:&quot;all&quot;,&quot;codemarkTagFilter&quot;:&quot;all&quot;,&quot;codemarkBranchFilter&quot;:&quot;all&quot;,&quot;codemarkAuthorFilter&quot;:&quot;all&quot;,&quot;codemarksFileViewStyle&quot;:&quot;inline&quot;,&quot;codemarksShowArchived&quot;:false,&quot;codemarksShowResolved&quot;:false,&quot;codemarksWrapComments&quot;:false,&quot;showFeedbackSmiley&quot;:true,&quot;route&quot;:{&quot;name&quot;:&quot;newUserEntry&quot;,&quot;params&quot;:{}},&quot;spatialViewShowPRComments&quot;:false,&quot;currentPullRequestNeedsRefresh&quot;:{&quot;needsRefresh&quot;:false,&quot;providerId&quot;:&quot;&quot;,&quot;pullRequestId&quot;:&quot;&quot;},&quot;__teamless__&quot;:{&quot;selectedRegion&quot;:&quot;us&quot;},&quot;sessionStart&quot;:1697686887737,&quot;isFirstPageview&quot;:false}" />
</component>
</project>

2
homework231008/.idea/homework231008.iml generated Normal file
View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<module classpath="CMake" type="CPP_MODULE" version="4" />

4
homework231008/.idea/misc.xml generated Normal file
View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
</project>

8
homework231008/.idea/modules.xml generated Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/homework231008.iml" filepath="$PROJECT_DIR$/.idea/homework231008.iml" />
</modules>
</component>
</project>

View File

@@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="2" type="CppFileRunConfiguration" factoryName="CppFileRunConfiguration" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="homework231008" TARGET_NAME="2.cpp" CONFIG_NAME="2">
<option name="compilerOptions" value="-o out/2" />
<option name="sourceFile" value="D:\Projects\homework231008\src\2.cpp" />
<method v="2">
<option name="com.jetbrains.cidr.cpp.runfile.CppFileBuildBeforeRunTaskProvider$BasicBuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

View File

@@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="4" type="CppFileRunConfiguration" factoryName="CppFileRunConfiguration" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="homework231008" TARGET_NAME="4.cpp" CONFIG_NAME="4">
<option name="compilerOptions" value="-o out/4" />
<option name="sourceFile" value="D:\Projects\homework231008\src\4.cpp" />
<method v="2">
<option name="com.jetbrains.cidr.cpp.runfile.CppFileBuildBeforeRunTaskProvider$BasicBuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

View File

@@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="7" type="CppFileRunConfiguration" factoryName="CppFileRunConfiguration" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="homework231008" TARGET_NAME="7.cpp" CONFIG_NAME="7">
<option name="compilerOptions" value="-o out/7" />
<option name="sourceFile" value="D:\Projects\homework231008\src\7.cpp" />
<method v="2">
<option name="com.jetbrains.cidr.cpp.runfile.CppFileBuildBeforeRunTaskProvider$BasicBuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

View File

@@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="9-1" type="CppFileRunConfiguration" factoryName="CppFileRunConfiguration" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="homework231008" TARGET_NAME="9-1.cpp" CONFIG_NAME="9-1">
<option name="compilerOptions" value="-o out/9-1" />
<option name="sourceFile" value="D:\Projects\homework231008\src\9-1.cpp" />
<method v="2">
<option name="com.jetbrains.cidr.cpp.runfile.CppFileBuildBeforeRunTaskProvider$BasicBuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

View File

@@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="9-2" type="CppFileRunConfiguration" factoryName="CppFileRunConfiguration" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="homework231008" TARGET_NAME="9-2.cpp" CONFIG_NAME="9-2">
<option name="compilerOptions" value="-o out/9-2" />
<option name="sourceFile" value="D:\Projects\homework231008\src\9-2.cpp" />
<method v="2">
<option name="com.jetbrains.cidr.cpp.runfile.CppFileBuildBeforeRunTaskProvider$BasicBuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>

View File

@@ -0,0 +1,2 @@
cmake_minimum_required(VERSION 3.26.1)
project(homework231008)

View File

@@ -0,0 +1,5 @@
2. a=10, b=0
4. 5
7. 2 3 1
9. (1) a % 2 == 0 || b % 2 == 0
(2) a % 3 == 0 , b % 5 == 0

14
homework231008/src/2.cpp Normal file
View File

@@ -0,0 +1,14 @@
//
// Created by Launchcore on 2023/10/8.
//
#include <iostream>
using namespace std;
int main()
{
int a = 10, b = 3;
b %= b++ || a++;
// b++ = 4, 在表达式(b++ || a++)中, b++相当于true, 此时a++不执行, a仍为10
// b %= b++ 在此相当于 b %= true (后面整个(b++ || a++)为true), 即b = b % 1, 结果为0
cout << a << '\t' << b << endl;
return 0;
}

11
homework231008/src/4.cpp Normal file
View File

@@ -0,0 +1,11 @@
//
// Created by Launchcore on 2023/10/8.
//
#include <iostream>
using namespace std;
int main()
{
int a = 35, b = 6;
cout << (!a + a % b) << endl;
return 0;
}

13
homework231008/src/7.cpp Normal file
View File

@@ -0,0 +1,13 @@
//
// Created by Launchcore on 2023/10/8.
//
#include <iostream>
using namespace std;
int main()
{
int a, b, c;
a = b = 1;
c = a++, b++, ++b;
cout << a << '\t' << b << '\t' << c << '\t' << endl;
return 0;
}

View File

@@ -0,0 +1,14 @@
//
// Created by Launchcore on 2023/10/8.
//
#include <iostream>
using namespace std;
int main()
{
int a, b;
cin >> a;
cin >> b;
bool c = a % 2 == 0 || b % 2 == 0;
cout << c << endl;
return 0;
}

View File

@@ -0,0 +1,14 @@
//
// Created by Launchcore on 2023/10/8.
//
#include <iostream>
using namespace std;
int main()
{
int a, b;
cin >> a;
cin >> b;
bool c = a % 3 == 0 , d = b % 5 == 0;
cout << c << '\t' << d << endl;
return 0;
}