From 94d0033ed89bb5bfb6500051296892fb7cea6c29 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 25 Dec 2023 17:56:34 +0100 Subject: Small cleanup --- 2023/01/1a.c | 3 +-- 2023/01/1b.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to '2023/01') diff --git a/2023/01/1a.c b/2023/01/1a.c index 0983236..229df20 100644 --- a/2023/01/1a.c +++ b/2023/01/1a.c @@ -9,8 +9,7 @@ int main() { sum = 0; while ((buf = fgets(line, N, stdin)) != NULL) { for (first = -1; *buf; buf++) { - if (*buf < '0' || *buf > '9') - continue; + if (*buf < '0' || *buf > '9') continue; first = first == -1 ? *buf - '0' : first; last = *buf - '0'; } diff --git a/2023/01/1b.c b/2023/01/1b.c index adc3da8..795571b 100644 --- a/2023/01/1b.c +++ b/2023/01/1b.c @@ -16,8 +16,7 @@ int main() { for (j = 1; j < 10; j++) if (!strncmp(buf, nums[j], strlen(nums[j]))) *buf = j + '0'; - if (*buf < '0' || *buf > '9') - continue; + if (*buf < '0' || *buf > '9') continue; first = first == -1 ? *buf - '0' : first; last = *buf - '0'; } -- cgit v1.3