blallblabla

This commit is contained in:
2026-06-09 09:18:05 +02:00
parent 0d7c0d381a
commit 4cf7dce6fc
7 changed files with 490 additions and 3 deletions

View File

@@ -3,7 +3,7 @@
template <typename T> T potroj(T x) { return x * 3; }
int main() {
std::cout << potroj(7) << '\n';
std::cout << potroj(2.5) << '\n';
std::cout << potroj('A') << '\n';
std::cout << potroj(7) << '\n'; // 21
std::cout << potroj(2.5) << '\n'; // 7.5
std::cout << potroj('A') << '\n'; // dziwny znak
}

View File

@@ -5,6 +5,7 @@ podwoj(2, 3); // funkcja przyjmuje jeden argument a jest wywołana z dwoma
// Fragment B
template <typename T> T iloczyn(T a, T b);
// definicja w innym pliku .cpp - kod się nie linkuje
// należy dodać #include "nazwa_pliku.cpp"
// Fragment C
template <typename T> T wiekszy(T a, T b) { return a > b ? a : b; }