aboutsummaryrefslogtreecommitdiff
path: root/2023/01/1b.c
diff options
context:
space:
mode:
Diffstat (limited to '2023/01/1b.c')
-rw-r--r--2023/01/1b.c3
1 files changed, 1 insertions, 2 deletions
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() {
16 for (j = 1; j < 10; j++) 16 for (j = 1; j < 10; j++)
17 if (!strncmp(buf, nums[j], strlen(nums[j]))) 17 if (!strncmp(buf, nums[j], strlen(nums[j])))
18 *buf = j + '0'; 18 *buf = j + '0';
19 if (*buf < '0' || *buf > '9') 19 if (*buf < '0' || *buf > '9') continue;
20 continue;
21 first = first == -1 ? *buf - '0' : first; 20 first = first == -1 ? *buf - '0' : first;
22 last = *buf - '0'; 21 last = *buf - '0';
23 } 22 }

Generated with cgit - Back to sebastiano.tronto.net