Skip to content

Commit

Permalink
fixed pezy#36
Browse files Browse the repository at this point in the history
  • Loading branch information
pezy committed Jul 27, 2015
1 parent 3930bc4 commit c0f487d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions ch06/ex6_42.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
//! @Yue Wang
//! @creator by Wang Yue
//! @refactor by pezy
//!
//! Exercise 6.42:
//! @date 27, July. 2015
//!
//! @question
//! Give the second parameter of make_plural (§ 6.3.2, p. 224) a default
//! argument of 's'. Test your program by printing singular and plural
//! versions of the words success and failure.
//! argument of 's'. Test your program by printing singular and plural versions
//! of the words success and failure.
//!

#include <iostream>
#include <string>

using std::string;
using std::cout;
using std::endl;
Expand All @@ -19,9 +23,9 @@ string make_plural(size_t ctr, const string& word, const string& ending = "s")

int main()
{
cout << "singual: " << make_plural(1, "success") << " "
cout << "singual: " << make_plural(1, "success", "es") << " "
<< make_plural(1, "failure") << endl;
cout << "plural : " << make_plural(2, "success") << " "
cout << "plural : " << make_plural(2, "success", "es") << " "
<< make_plural(2, "failure") << endl;

return 0;
Expand Down

0 comments on commit c0f487d

Please sign in to comment.