From 6b033604ef4a8a35175426d0a1654ba878d7fef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com> Date: Sun, 4 Feb 2024 10:20:50 +0800 Subject: [PATCH] 'commit' --- GESP/202312_2_1.cpp | 18 ++++++++++++++++++ GESP/202312_2_2.cpp | 19 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 GESP/202312_2_1.cpp create mode 100644 GESP/202312_2_2.cpp diff --git a/GESP/202312_2_1.cpp b/GESP/202312_2_1.cpp new file mode 100644 index 0000000..d1dda9b --- /dev/null +++ b/GESP/202312_2_1.cpp @@ -0,0 +1,18 @@ +#include +using namespace std; +const int N = 366; +int a[N]; +int sum; +int main() { + cin >> a[1] >> a[2]; // 第一天a[1]道题,第二天a[2]道题 + int n, m; + cin >> m >> n; + sum += a[1], sum += a[2]; + for (int i = 3;; i++) { + a[i] = a[i - 1] + a[i - 2]; + if (a[i] >= m) break; + sum += a[i]; + } + cout << sum << endl; + return 0; +} \ No newline at end of file diff --git a/GESP/202312_2_2.cpp b/GESP/202312_2_2.cpp new file mode 100644 index 0000000..5fc93f6 --- /dev/null +++ b/GESP/202312_2_2.cpp @@ -0,0 +1,19 @@ +#include +using namespace std; +int main() { + int n; + cin >> n; + for (int i = 1; i <= n; i++) { + for (int j = 1; j <= n; j++) { + if (j == 1 || j == n) + cout << "|"; + else if (i == (n + 1) / 2) { + cout << "-"; + } else + cout << "a"; + } + cout << endl; + } + + return 0; +} \ No newline at end of file