From cd0fee3b699311298716c4f70310561d0b82e1ae Mon Sep 17 00:00:00 2001 From: Jdhggg <24016020834@stu.nsu.edu.cn> Date: Fri, 21 Mar 2025 00:59:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=90=88=E5=B9=B6=E5=87=BD?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Project2/Debug/Project2.log | 2 ++ .../Debug/Project2.tlog/CL.command.1.tlog | Bin 2958 -> 2958 bytes Project2/Debug/Project2.tlog/CL.read.1.tlog | Bin 13514 -> 12738 bytes Project2/Debug/Project2.tlog/CL.write.1.tlog | Bin 4354 -> 3944 bytes sq_list.c | 22 +++++++++--------- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Project2/Debug/Project2.log b/Project2/Debug/Project2.log index 259d036..864d6f9 100644 --- a/Project2/Debug/Project2.log +++ b/Project2/Debug/Project2.log @@ -1,2 +1,4 @@  main.c + sq_list.c + 正在生成代码... Project2.vcxproj -> C:\code\lencode\Project2\Debug\Project2.exe diff --git a/Project2/Debug/Project2.tlog/CL.command.1.tlog b/Project2/Debug/Project2.tlog/CL.command.1.tlog index 5c9a976e2c6a6a350957d2dd3674b2b7fd78b10b..63d02921de1fab87535df6fd4037ea928c5a202a 100644 GIT binary patch delta 25 dcmeAZ?-So3$2Pf+TVS&Xa|IKa@rv~Z698%J2x|ZU delta 17 ZcmeAZ?-So3$F}(u#}cN^uUOA80RTJg2HF4s diff --git a/Project2/Debug/Project2.tlog/CL.read.1.tlog b/Project2/Debug/Project2.tlog/CL.read.1.tlog index 0ee1b329dc02914d2336ef9db6c6adfa2fb365d6..48850f0118d0a23e75ea6b0a6fb03dec1a78536f 100644 GIT binary patch delta 34 ocmX?=c_?|q64A*as$!e#xaV+gexOjoGMP(NV58p(5XXT9005>9X#fBK delta 424 zcmX?Re1L2x21g+6$q)skLx8kD zP)!U_-k%`|%=ZJTL-1V~Tp8SeDno&KLKyUbYJC`jCx6smIr#~fLbwrw0fQ-n5m3D| zP&^c9njX+TA0Xsq-~x(S0cFr#5zG(?v@HZ^t}lZzSZ@f>EkQtjFiiL4Lhas7JW`yK WKd?7!z9#>LdGZobv0>w#1Iz$`T~c)b diff --git a/Project2/Debug/Project2.tlog/CL.write.1.tlog b/Project2/Debug/Project2.tlog/CL.write.1.tlog index 5e17f1198edf405d0a3b628a9a73c293e582d897..f8a0555a6e2cfb6ccf6c1533844a180bb5975868 100644 GIT binary patch delta 23 ecmZotdLg&LiEpwT56|QV=B&wD943?FcxnJ%5eH@f delta 24 gcmaDM*QB(;iEncpj}PNyKE73x9T>MwPGAxN0Bk}C0RR91 diff --git a/sq_list.c b/sq_list.c index a4ac840..3d69003 100644 --- a/sq_list.c +++ b/sq_list.c @@ -62,7 +62,7 @@ void insert_sq_list(sq_list* list, int pos, int value) list->data[i + 1] = list->data[i]; } list->data[pos] = value; - if (flog + 1 > list->length) + /* if (flog + 1 > list->length)*/ list->length++; } @@ -93,24 +93,24 @@ void merge_sq_list(sq_list* list_1, sq_list* list_2) for (int i = 0; i < list_2->length; i++) { - for (int j = 0; j < list_1->length; j++) + for (int j = 0; j < list_1->length; j++) { if (list_1->data[j] != list_2->data[i]) - continue; - else if (list_1->data[j] == list_2->data[i]) { - flog++; break; - } - else - { - list_1->data[list_1->length] = list_2->data[i]; - list_1->length++; + if (j == list_1->length -1) + { + list_1->data[list_1->length] = list_2->data[i]; + list_1->length++; + flog++; + } + else + continue; } } } printf("----------------------------------\n"); - printf("%dͬ %dͬ\n", flog, list_2->length - flog); + printf("%dͬ %dͬ\n", flog, list_2->length - flog); printf("----------------------------------\n"); }