From cad1ffad7d11702ade37e6aba35b4701d8554f1d Mon Sep 17 00:00:00 2001 From: Dmitry Kokorin Date: Tue, 1 Mar 2016 00:08:38 +0300 Subject: [PATCH] beer_song: cleanup --- cpp/beer-song/beer_song.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cpp/beer-song/beer_song.cpp b/cpp/beer-song/beer_song.cpp index 5580859..9b084ea 100644 --- a/cpp/beer-song/beer_song.cpp +++ b/cpp/beer-song/beer_song.cpp @@ -12,13 +12,13 @@ string verse(int index) auto count_str = [](int count) -> string { if (0 == count) - return "no more bottles "; + return "no more bottles"; if (1 == count) - return "1 bottle "; + return "1 bottle"; ostringstream oss; - oss << count << " bottles "; + oss << count << " bottles"; return oss.str(); }; @@ -31,15 +31,15 @@ string verse(int index) }; return capitalize_first(count_str(index)) - + "of beer on the wall, " + + " of beer on the wall, " + count_str(index) - + "of beer.\n" + + " of beer.\n" + (index ? string("Take ") + (index == 1 ? "it" : "one") + " down and pass it around, " : string("Go to the store and buy some more, ")) + count_str(index ? index - 1 : 99) - + "of beer on the wall.\n"; + + " of beer on the wall.\n"; } string sing(int from_index, int to_index)