From 3277de12c2a3682368ecf351877ae54923704be6 Mon Sep 17 00:00:00 2001 From: Zhineng Li Date: Sat, 10 Jan 2026 18:13:21 +0800 Subject: ex01-13: rename variable `nlen` --- ch01/ex13-histogram.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ch01/ex13-histogram.c') diff --git a/ch01/ex13-histogram.c b/ch01/ex13-histogram.c index 14002a5..fbccb2a 100644 --- a/ch01/ex13-histogram.c +++ b/ch01/ex13-histogram.c @@ -7,10 +7,10 @@ int main() { int c, i, j, nc, state; - int ndigit[10]; + int nlen[10]; for (i = 0; i < 10; ++i) - ndigit[i] = 0; + nlen[i] = 0; nc = 0; state = OUT; @@ -20,7 +20,7 @@ int main() i = nc - 1; if (i > 9) i = 9; - ++ndigit[i]; + ++nlen[i]; nc = 0; } state = OUT; @@ -36,7 +36,7 @@ int main() i = nc - 1; if (i > 9) i = 9; - ++ndigit[i]; + ++nlen[i]; nc = 0; } @@ -45,7 +45,7 @@ int main() printf(" >9: "); else printf(" %2d: ", i + 1); - for (j = 0; j < ndigit[i]; ++j) + for (j = 0; j < nlen[i]; ++j) putchar('#'); putchar('\n'); } -- cgit v1.2.3