Skip to content

Commit

Permalink
补充知识点
Browse files Browse the repository at this point in the history
  • Loading branch information
haiduo committed Aug 14, 2019
1 parent fbf2ef1 commit 64b177b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions excersize/ch05.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ int main()
{
unsigned aCnt = 0, eCnt = 0, iCnt = 0, oCnt = 0, uCnt = 0, spaceCnt = 0, tabCnt = 0, newLineCnt = 0;
char ch;
while (cin >> std::noskipws >> ch)
while (cin >> std::noskipws >> ch) //noskipws(no skip whitespce)
switch (ch)
{
case 'a':
Expand Down Expand Up @@ -664,7 +664,7 @@ int main()
while (cin >> read)
if (read == tmp) break; else tmp = read;

if (cin.eof()) cout << "no word was repeated." << endl;
if (cin.eof()) cout << "no word was repeated." << endl; //eof(end of file)判断输入是否结束,或者文件结束符,等同于 CTRL+Z
else cout << read << " occurs twice in succession." << endl;

return 0;
Expand Down

0 comments on commit 64b177b

Please sign in to comment.