20101029

[C_Programming]Ex1-16

題目:
Revise the main routine of the longest-line program so it will correctly print the length of arbitrarily long input lines, and as much as possible of the text.

解法:
一直卡在當overflow時,i會自動再run一次getline(),我不知道為什麼,所以無法直接測出該行字串的長度(如果溢位的話)。於是用另一個j來測量長度,i只做getline的動作。

沒有留言: