init commit

This commit is contained in:
2025-04-13 21:48:15 +03:00
commit 23255e9121
192 changed files with 12200 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
#include <iterator>
template <typename Container>
typename Container::value_type process(const Container& container) {
using ValueType = typename Container::value_type;
if (container.empty()) {
return ValueType{};
}
auto it = container.rbegin();
ValueType sum = *it;
for (int i = 0; it != container.rend() && i < 5; ++i, ++it) {
if (i == 2 || i == 4) {
sum += *it;
}
}
return sum;
}