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.98 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.97 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.96 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.95 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.94 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.93 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.92 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.91 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.90 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.89 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.88 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.87 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.86 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.85 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.84 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.83 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.82 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.81 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.80 tracks/cpp/exercises/raindrops/example.cpp
trackler-2.2.1.79 tracks/cpp/exercises/raindrops/example.cpp