#ifndef findH #define findH #include #include #include template inputIterator _find(inputIterator first, inputIterator last, T theValue) { while(first != last) { if (*first == theValue) return first; first++; } return last; } void test() { std::vector vec = { 3, 4, 8, 2, 4, 1 }; if (_find(vec.begin(), vec.end(), 4) != vec.end()) std::cout << "4 est bien présent\n"; // Classer des valeurs std::cout << "Element maximal: " << *(std::max_element(vec.begin(), vec.end())) << "\n"; std::sort(vec.begin(), vec.end()); for (auto it = vec.begin(); it != vec.end(); it++) std::cout << *it << ", "; std::cout << "\n"; } #endif // ! findH