Sha256: f927ef7165141b0ee9a66b9d93b06c44f6198aad1c1b188950c03edcfbd21700
Contents?: true
Size: 533 Bytes
Versions: 396
Compression:
Stored size: 533 Bytes
Contents
#include "raindrops.h" #include <sstream> using namespace std; namespace raindrops { string convert(int drops) { const int pling_factor{3}; const int plang_factor{5}; const int plong_factor{7}; ostringstream result; if (drops % pling_factor == 0) { result << "Pling"; } if (drops % plang_factor == 0) { result << "Plang"; } if (drops % plong_factor == 0) { result << "Plong"; } if (!result.tellp()) { result << drops; } return result.str(); } }
Version data entries
396 entries across 396 versions & 1 rubygems