今天开始看K&R的TCPL,发现好多单词都不认识,要么就是不知道意思,要么是计算机专业术语了,不太了解这个领域类的黑话……要多加积累。不妨列出来,已备后面查看,和我一样的菜鸟也可以以此检验一下自己
indent truncate substitute augment fraction omitted elimination readily conform interleaved subtle internally shrink carry out impenetrable curb illustrate suppresses isolated newline parenthesized literal clarity modest escape alternative subscripts consecutive histogram ^
一不小心竟然有这么多,看原版书真的不容易,很多地方试着自己去翻译,也是比较难啊 …… 所以对某些翻译质量,宽容吧……
本来不想写程序的,但是不愧是老外写的书,竟然让我有写程序的冲动,就是这题:
Exercise 1-13. Write a program to print a histogram of the lengths of words in its input. It is easy to draw the histogram with the bars horizontal ; a vertical orientation is more challenging.
好就做一个竖着的……
这里的EOF在windows下我是通过ctrl+z实现的。
但是当EOF在world!之后时, 效果是
程序将world和why放在一起计数了,我在想为什么world和EOF放在同一行,EOF的作用没有体现呢?