Initial Course

This commit is contained in:
David Gil de Gómez Pérez
2026-08-11 17:40:36 +03:00
commit 9aed1d1d86
202 changed files with 3420 additions and 0 deletions
@@ -0,0 +1,11 @@
#pragma once
#include <string>
namespace functions {
[[nodiscard]] auto repeat(char ch, int count = 1) -> std::string;
[[nodiscard]] auto power(int base, int exponent = 2) -> long long;
[[nodiscard]] auto clamp(int value, int min = 0, int max = 100) -> int;
} // namespace functions
@@ -0,0 +1,13 @@
#pragma once
#include <string>
#include <vector>
namespace functions {
[[nodiscard]] auto square(int value) -> int;
void swap_integers(int& lhs, int& rhs);
[[nodiscard]] auto concatenate(const std::vector<std::string>& parts) -> std::string;
void append_suffix(std::string& text, const std::string& suffix);
} // namespace functions
@@ -0,0 +1,13 @@
#pragma once
#include <string>
namespace functions {
[[nodiscard]] auto max_value(int a, int b) -> int;
[[nodiscard]] auto max_value(double a, double b) -> double;
[[nodiscard]] auto max_value(const std::string& a, const std::string& b) -> std::string;
[[nodiscard]] auto area(int side) -> int;
[[nodiscard]] auto area(int width, int height) -> int;
} // namespace functions
@@ -0,0 +1,9 @@
#pragma once
namespace functions {
[[nodiscard]] auto fibonacci(int n) -> long long;
[[nodiscard]] auto sum_digits(int n) -> int;
[[nodiscard]] auto is_palindrome(int n) -> bool;
} // namespace functions