Initial commit with cleaned history

This commit is contained in:
2024-09-01 18:09:25 +02:00
commit 208004e9d0
273 changed files with 234697 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
//g++ -std=c++14 -Wall -Wextra -Werror -pedantic ./w5/min.cpp -o ./bin/min && ./bin/min
#include <iostream>
#include <vector>
int min(const std::vector<int>& vec);
int main() {
std::vector<int> testVec = {10, 20, 2, 0, 30};
std::cout << "The minimum value in the vector is: " << min(testVec) << std::endl;
}
int min(const std::vector<int>& vec) {
int minVal = vec[0];
for (unsigned i = 1; i < vec.size(); ++i) {
if (vec[i] < minVal) {
minVal = vec[i];
}
}
return minVal;
}