2023-10-19
This commit is contained in:
10
homework231008/.idea/.gitignore
generated
vendored
Normal file
10
homework231008/.idea/.gitignore
generated
vendored
Normal 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
7
homework231008/.idea/codestream.xml
generated
Normal 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="{"chatProviderAccess":"strict","currentTeamId":"6512335c1eb5d01756fa399a","currentStreamId":"","pullRequestCheckoutBranch":false,"isRepositioning":false,"onboardStep":0,"panelStack":["landing-redirect"],"hasFocus":false,"channelFilter":"all","channelsMuteAll":false,"codemarkFileFilter":"all","codemarkTypeFilter":"all","codemarkTagFilter":"all","codemarkBranchFilter":"all","codemarkAuthorFilter":"all","codemarksFileViewStyle":"inline","codemarksShowArchived":false,"codemarksShowResolved":false,"codemarksWrapComments":false,"showFeedbackSmiley":true,"route":{"name":"newUserEntry","params":{}},"spatialViewShowPRComments":false,"currentPullRequestNeedsRefresh":{"needsRefresh":false,"providerId":"","pullRequestId":""},"__teamless__":{"selectedRegion":"us"},"sessionStart":1697686887737,"isFirstPageview":false}" />
|
||||
</component>
|
||||
</project>
|
||||
2
homework231008/.idea/homework231008.iml
generated
Normal file
2
homework231008/.idea/homework231008.iml
generated
Normal 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
4
homework231008/.idea/misc.xml
generated
Normal 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
8
homework231008/.idea/modules.xml
generated
Normal 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>
|
||||
9
homework231008/.idea/runConfigurations/2.xml
generated
Normal file
9
homework231008/.idea/runConfigurations/2.xml
generated
Normal 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>
|
||||
9
homework231008/.idea/runConfigurations/4.xml
generated
Normal file
9
homework231008/.idea/runConfigurations/4.xml
generated
Normal 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>
|
||||
9
homework231008/.idea/runConfigurations/7.xml
generated
Normal file
9
homework231008/.idea/runConfigurations/7.xml
generated
Normal 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>
|
||||
9
homework231008/.idea/runConfigurations/9_1.xml
generated
Normal file
9
homework231008/.idea/runConfigurations/9_1.xml
generated
Normal 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>
|
||||
9
homework231008/.idea/runConfigurations/9_2.xml
generated
Normal file
9
homework231008/.idea/runConfigurations/9_2.xml
generated
Normal 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>
|
||||
2
homework231008/CMakeLists.txt
Normal file
2
homework231008/CMakeLists.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
cmake_minimum_required(VERSION 3.26.1)
|
||||
project(homework231008)
|
||||
5
homework231008/answer.txt
Normal file
5
homework231008/answer.txt
Normal 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
14
homework231008/src/2.cpp
Normal 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
11
homework231008/src/4.cpp
Normal 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
13
homework231008/src/7.cpp
Normal 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;
|
||||
}
|
||||
14
homework231008/src/9-1.cpp
Normal file
14
homework231008/src/9-1.cpp
Normal 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;
|
||||
}
|
||||
14
homework231008/src/9-2.cpp
Normal file
14
homework231008/src/9-2.cpp
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user