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,9 @@
#include "default_parameters.hpp"
namespace functions {
auto repeat(char ch, int count) -> std::string { (void)ch; (void)count; return {}; }
auto power(int base, int exponent) -> long long { (void)base; (void)exponent; return 0; }
auto clamp(int value, int min, int max) -> int { (void)value; (void)min; (void)max; return 0; }
} // namespace functions
@@ -0,0 +1,10 @@
#include "function_basics.hpp"
namespace functions {
auto square(int value) -> int { (void)value; return 0; }
void swap_integers(int& lhs, int& rhs) { (void)lhs; (void)rhs; }
auto concatenate(const std::vector<std::string>& parts) -> std::string { (void)parts; return {}; }
void append_suffix(std::string& text, const std::string& suffix) { (void)text; (void)suffix; }
} // namespace functions
+11
View File
@@ -0,0 +1,11 @@
#include "overloading.hpp"
namespace functions {
auto max_value(int a, int b) -> int { (void)a; (void)b; return 0; }
auto max_value(double a, double b) -> double { (void)a; (void)b; return 0.0; }
auto max_value(const std::string& a, const std::string& b) -> std::string { (void)a; (void)b; return {}; }
auto area(int side) -> int { (void)side; return 0; }
auto area(int width, int height) -> int { (void)width; (void)height; return 0; }
} // namespace functions
+9
View File
@@ -0,0 +1,9 @@
#include "recursion.hpp"
namespace functions {
auto fibonacci(int n) -> long long { (void)n; return 0; }
auto sum_digits(int n) -> int { (void)n; return 0; }
auto is_palindrome(int n) -> bool { (void)n; return false; }
} // namespace functions