From 7855d37e65d51d3449ea02d86ded49be66ff5d6a Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Thu, 2 Dec 2021 09:53:38 -0500 Subject: [PATCH] day1: Replace fscanf(stdin) with scanf --- 1/c/a.c | 2 +- 1/c/b.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/1/c/a.c b/1/c/a.c index 39ce157..f593356 100644 --- a/1/c/a.c +++ b/1/c/a.c @@ -5,7 +5,7 @@ int main(void) { int count = 0; int curr; int prev = 0; - while(fscanf(stdin, "%d\n", &curr) != EOF) { + while(scanf("%d\n", &curr) != EOF) { if (prev && curr > prev) { count++; } diff --git a/1/c/b.c b/1/c/b.c index 00e35c7..93f6153 100644 --- a/1/c/b.c +++ b/1/c/b.c @@ -11,7 +11,7 @@ int main(void) { int curr; int prev = 0; int i = 0; - while(fscanf(stdin, "%d\n", &curr) != EOF) { + while(scanf("%d\n", &curr) != EOF) { mem[i++ % 3] = curr; if (i > 3) { if (prev && sum() > prev) { -- libgit2 1.8.1