#include <iostream>
auto main(int argc, char* argv[])->int
{
auto how_many_bottles = (argc > 1) ? std::stoi(argv[1]) : 99;
for (auto i=how_many_bottles; i>=0; i--)
{
if (i == 0)
{
std::cout << "No more bottles of beer on the wall,"
<< " no more bottles of beer.\n"
<< "Go to the store and buy some more, " << how_many_bottles
<< " bottles of beer on the wall.\n" << std::endl;
}
else
{
std::cout << i << " bottles of beer on the wall, "
<< i << " bottles of beer.\n"
<< "Take one down and pass it around, ";
(i == 1) ? std::cout << "no more" : std::cout << i-1;
std::cout << " bottles of beer on the wall.\n" << std::endl;
}
}
return 0;
}