Sha256: 40dfadf39bbef25796df57140199a90f99deaea84e5ef29a3f5c1060b0a196f1
Contents?: true
Size: 361 Bytes
Versions: 396
Compression:
Stored size: 361 Bytes
Contents
#include "sum_of_multiples.h" namespace sum_of_multiples { int to(std::initializer_list<int> const& multiples, int num) { int sum = 0; for (int i = 0; i < num; ++i) { for (const int multiple : multiples) { if (i % multiple == 0) { sum += i; break; } } } return sum; } }
Version data entries
396 entries across 396 versions & 1 rubygems