1
0

」 feat: finished ex02

This commit is contained in:
2025-06-04 14:05:48 +02:00
parent 6b00e95da9
commit 60e3d482e4
6 changed files with 270 additions and 0 deletions

34
ex02/main.cpp Normal file
View File

@ -0,0 +1,34 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/06/04 13:26:50 by adjoly #+# #+# */
/* Updated: 2025/06/04 13:44:29 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include <PmergeMe.hpp>
int main(int argc, char **argv) {
if (argc < 2) {
std::cerr << "Error: No input provided" << std::endl;
return 1;
}
try {
std::vector<int> inputVector = parseInput(argc, argv);
std::deque<int> inputDeque(inputVector.begin(), inputVector.end());
std::cout << "Before: ";
printContainer(inputVector);
sortAndTime(inputVector, inputDeque);
} catch (const std::exception &e) {
std::cerr << "Error: " << e.what() << std::endl;
return 1;
}
}