From fa2e0c39c760dbca64c378bcaf6f25d11003995d Mon Sep 17 00:00:00 2001 From: leo12025 Date: Mon, 4 Aug 2025 17:13:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E5=8E=A2=E7=9A=84=E8=B4=A7=E7=89=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test01/main.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/test01/main.cpp b/test01/main.cpp index a7cd33d..7cd4fc4 100644 --- a/test01/main.cpp +++ b/test01/main.cpp @@ -1,22 +1,15 @@ #include "iostream" using namespace std; -int n; +int a[105], n; int main() { cin >> n; - if (n != 1) { - while (n > 1) { - if (n % 2 == 0) { - n = n / 2; - } else { - n = n * 3 + 1; - } - cout << n << " "; - } - cout << endl << "END"; - } else { - cout << "END"; + for (int i = 1; i <= n; i++) { + cin >> a[i]; + } + for (int i = 1; i <= n; i++) { + cout << a[i]; } return 0; }