diff options
| author | Zhineng Li <[email protected]> | 2026-01-10 18:15:14 +0800 |
|---|---|---|
| committer | Zhineng Li <[email protected]> | 2026-01-10 18:15:14 +0800 |
| commit | 20d3661062b7b42fcfa91cc9b43f2a6752804e62 (patch) | |
| tree | cba09a17cb8db46666405a322b161a491137feed /ch01/ex13-histogram.c | |
| parent | 3277de12c2a3682368ecf351877ae54923704be6 (diff) | |
| download | c-knr-exercises-20d3661062b7b42fcfa91cc9b43f2a6752804e62.tar.gz c-knr-exercises-20d3661062b7b42fcfa91cc9b43f2a6752804e62.zip | |
ex01-13: extract bar character
Diffstat (limited to 'ch01/ex13-histogram.c')
| -rw-r--r-- | ch01/ex13-histogram.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ch01/ex13-histogram.c b/ch01/ex13-histogram.c index fbccb2a..47ed574 100644 --- a/ch01/ex13-histogram.c +++ b/ch01/ex13-histogram.c @@ -3,6 +3,8 @@ #define IN 1 /* inside a word */ #define OUT 0 /* outside a word */ +#define INDICATOR_BAR '#' + /* print a histogram of word lengths */ int main() { @@ -46,7 +48,7 @@ int main() else printf(" %2d: ", i + 1); for (j = 0; j < nlen[i]; ++j) - putchar('#'); + putchar(INDICATOR_BAR); putchar('\n'); } } |
