From 25e3fb1d7c558ef5ba708593c224c117c2a0aa15 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Fri, 11 Oct 2024 13:51:16 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=AE=9E=E8=B7=B5=E8=AF=BE=E5=A4=96?= =?UTF-8?q?=E3=80=910.=E7=86=9F=E6=82=89=E7=BC=96=E7=A8=8B=E7=8E=AF?= =?UTF-8?q?=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://pintia.cn/problem-sets/1843619170005204992 --- .../7-1 重要的话说三遍.cpp | 16 ++++++++++++++++ 【实践课外】0.熟悉编程环境/7-2 计算平均分.cpp | 14 ++++++++++++++ .../7-3 计算长方形的周长和面积.cpp | 19 +++++++++++++++++++ 【实践课外】0.熟悉编程环境/7-4 简单最值.cpp | 19 +++++++++++++++++++ 4 files changed, 68 insertions(+) create mode 100644 【实践课外】0.熟悉编程环境/7-1 重要的话说三遍.cpp create mode 100644 【实践课外】0.熟悉编程环境/7-2 计算平均分.cpp create mode 100644 【实践课外】0.熟悉编程环境/7-3 计算长方形的周长和面积.cpp create mode 100644 【实践课外】0.熟悉编程环境/7-4 简单最值.cpp diff --git a/【实践课外】0.熟悉编程环境/7-1 重要的话说三遍.cpp b/【实践课外】0.熟悉编程环境/7-1 重要的话说三遍.cpp new file mode 100644 index 0000000..667f732 --- /dev/null +++ b/【实践课外】0.熟悉编程环境/7-1 重要的话说三遍.cpp @@ -0,0 +1,16 @@ +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +int main() { + std::ios::sync_with_stdio(false); + cin.tie(nullptr); + + cout << "I'm gonna WIN!" << endl; + cout << "I'm gonna WIN!" << endl; + cout << "I'm gonna WIN!" << endl; + + return 0; +} diff --git a/【实践课外】0.熟悉编程环境/7-2 计算平均分.cpp b/【实践课外】0.熟悉编程环境/7-2 计算平均分.cpp new file mode 100644 index 0000000..afb0068 --- /dev/null +++ b/【实践课外】0.熟悉编程环境/7-2 计算平均分.cpp @@ -0,0 +1,14 @@ +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +int main() { + std::ios::sync_with_stdio(false); + cin.tie(nullptr); + + cout << "math = 87, eng = 72, comp = 93, average = " << (87 + 72 + 93) / 3 << endl; + + return 0; +} diff --git a/【实践课外】0.熟悉编程环境/7-3 计算长方形的周长和面积.cpp b/【实践课外】0.熟悉编程环境/7-3 计算长方形的周长和面积.cpp new file mode 100644 index 0000000..1103c82 --- /dev/null +++ b/【实践课外】0.熟悉编程环境/7-3 计算长方形的周长和面积.cpp @@ -0,0 +1,19 @@ +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +int main() { + std::ios::sync_with_stdio(false); + cin.tie(nullptr); + + int a, b; + + cin >> a >> b; + + cout << "C = " << (a + b) * 2 << endl; + cout << "S = " << a * b << endl; + + return 0; +} diff --git a/【实践课外】0.熟悉编程环境/7-4 简单最值.cpp b/【实践课外】0.熟悉编程环境/7-4 简单最值.cpp new file mode 100644 index 0000000..45903e4 --- /dev/null +++ b/【实践课外】0.熟悉编程环境/7-4 简单最值.cpp @@ -0,0 +1,19 @@ +#include +#include + +using std::cin; +using std::cout; +const char endl = '\n'; + +int main() { + std::ios::sync_with_stdio(false); + cin.tie(nullptr); + + int a, b, c; + + cin >> a >> b >> c; + + cout << std::max({a, b, c}) << endl; + + return 0; +}