Skip to content

Commit

Permalink
Update 5.14.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
jaege authored Jun 5, 2020
1 parent 84b6061 commit 732276e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ch5/5.14.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ int main() {
maxDuplicatedWord = duplicatedWord;
maxCnt = cnt;
}
std::cout << maxDuplicatedWord << " occurs " << maxCnt
<< " time" << (maxCnt > 1 ? "s" : "") << ". " << std::endl;

if (maxCnt > 1) {
std::cout << maxDuplicatedWord << " occurs " << maxCnt
<< " times." << std::endl;
} else {
std::cout << "No word was repeated." << std::endl;
}
return 0;
}

0 comments on commit 732276e

Please sign in to comment.