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

Version Path
trackler-2.0.0.5 tracks/cpp/raindrops/example.cpp
trackler-2.0.0.4 tracks/cpp/raindrops/example.cpp
trackler-2.0.0.3 tracks/cpp/raindrops/example.cpp
trackler-2.0.0.2 tracks/cpp/raindrops/example.cpp
trackler-2.0.0.1 tracks/cpp/raindrops/example.cpp
trackler-2.0.0.0 tracks/cpp/raindrops/example.cpp
trackler-1.0.4.1 tracks/cpp/raindrops/example.cpp
trackler-1.0.4.0 tracks/cpp/raindrops/example.cpp
trackler-1.0.3.0 tracks/cpp/raindrops/example.cpp
trackler-1.0.2.1 tracks/cpp/raindrops/example.cpp
trackler-1.0.2.0 tracks/cpp/raindrops/example.cpp
trackler-1.0.1.2 tracks/cpp/raindrops/example.cpp
trackler-1.0.1.1 tracks/cpp/raindrops/example.cpp
trackler-1.0.1.0 tracks/cpp/raindrops/example.cpp
trackler-1.0.0.1 tracks/cpp/raindrops/example.cpp
trackler-1.0.0 tracks/cpp/raindrops/example.cpp