Solved: 09 - Default Parameters

This commit is contained in:
David Gil de Gómez Pérez
2026-08-12 17:02:13 +03:00
parent d1fbb1edbd
commit 3c4777e840
@@ -1,9 +1,26 @@
#include "default_parameters.hpp" #include "default_parameters.hpp"
#include <cmath>
#include <sstream>
namespace functions { namespace functions {
auto repeat(char ch, int count) -> std::string { (void)ch; (void)count; return {}; } auto repeat(const char ch, const int count) -> std::string {
auto power(int base, int exponent) -> long long { (void)base; (void)exponent; return 0; } std::ostringstream oss;
auto clamp(int value, int min, int max) -> int { (void)value; (void)min; (void)max; return 0; } for (int i = 0; i < count; i++) {
oss << ch;
}
return oss.str();
}
auto power(const int base, const int exponent) -> long long {
return std::pow(base, exponent);
}
auto clamp(const int value, const int min, const int max) -> int {
if (value < min) return min;
if (value > max) return max;
return value;
}
} // namespace functions } // namespace functions