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.2.1.180 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.179 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.178 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.177 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.176 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.175 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.174 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.173 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.172 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.171 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.170 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.169 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.167 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.166 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.165 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.164 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.163 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.162 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.161 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.160 tracks/cpp/exercises/raindrops/example.cpp