AfanasevGad7

This is a task for our favourite professor
git clone git://git.stellar-nexus.ru/AfanasevGad7
Log | Files | Refs | README

commit 95e7e09b30a57a7a307192c0cb0661e6773f6578
parent 177016b359d36e1e934f0a6761e151f290429287
Author: Plat <plat@stellar-nexus.ru>
Date:   Thu,  6 Nov 2025 20:34:58 +0000

Changed parser for Red-Black

Diffstat:
Mrb.c | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/rb.c b/rb.c @@ -112,15 +112,19 @@ main(int argc, char *argv[]) int arr[1000000], ch; char w[64]; for (int i = 0, wi = 0; (ch = fgetc(file)) != EOF; ) { - if (ch != ' ') { + if (!isspace(ch)) { w[wi++] = ch; - } else { + } else if (wi > 0) { w[wi] = '\0'; arr[i++] = estrtonum(w, 0, INT_MAX); wi = 0; } } + if (wi > 0) { + w[wi] = '\0'; + arr[i++] = estrtonum(w, 0, INT_MAX); + } efshut(file, filename); Node *root = NULL;