From 0b60204e6b204ed6ee41faed532411949a99d956 Mon Sep 17 00:00:00 2001 From: Eyre_S Date: Wed, 26 Oct 2022 23:48:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=20log,=20=E4=BF=AE=E5=A4=8D=E4=BA=86=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E5=B0=8F=E4=BA=BA=E7=9A=84=20id=20=E4=B8=8D?= =?UTF-8?q?=E5=AF=B9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- quiz4/quiz4.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/quiz4/quiz4.cpp b/quiz4/quiz4.cpp index af1dddf..db0e15a 100644 --- a/quiz4/quiz4.cpp +++ b/quiz4/quiz4.cpp @@ -50,16 +50,18 @@ int main () { } node* first = new node; - (*first).id = 0; + (*first).id = 1; (*first).prev = first; (*first).next = first; int count = 1; + std::cout << "招募了小人 #" << 1 << " ." << std::endl; for (int i = 2; i <= n; i++) { node* curr = new node; (*curr).id = i; insert_one(first, curr); count++; + std::cout << "招募了小人 #" << 1 << " , 它前面是 #" << (*(*curr).prev).id << " , 它后面是 #" << (*(*curr).next).id << std::endl; } int counting = 0; @@ -68,7 +70,7 @@ int main () { node* current = next_one; next_one = (*next_one).next; counting++; - std::cout << "小人 #" << (*current).id << "数到了" << counting; + std::cout << "小人 #" << (*current).id << " 数到了" << counting; if (counting == 3) { remove_one(current); counting = 0;