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; +}