mirror of
https://github.com/szymon-jozef/ZUT-notatki.git
synced 2026-10-28 11:10:38 +01:00
bla bla
This commit is contained in:
27
uczelnia/2_semestr/programowanie/laby/lab12/narzedzia.hpp
Normal file
27
uczelnia/2_semestr/programowanie/laby/lab12/narzedzia.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
template <typename T> T wiekszy(T a, T b) { return a > b ? a : b; }
|
||||
|
||||
template <typename T> void zamien(T &a, T &b) {
|
||||
T c = a;
|
||||
a = b;
|
||||
b = c;
|
||||
}
|
||||
|
||||
template <typename T> void wypisz(T *tab, int n) {
|
||||
for (int i = 0; i < n; i++) {
|
||||
std::cout << *(tab + i);
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
template <typename T> void sortuj3(T a, T b, T c) {
|
||||
std::vector<T> vec{a, b, c};
|
||||
std::sort(vec.begin(), vec.end());
|
||||
|
||||
for (const auto &symbol : vec) {
|
||||
std::cout << symbol;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user