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