cpp algorithm iota
#include <iostream>
#include <numeric>
#include <vector>
int main() {
// Declare a vector of integers
std::vector<int> numbers(5);
// Use the iota algorithm to fill the vector with sequential values starting from 1
std::iota(numbers.begin(), numbers.end(), 1);
// Print the elements of the vector
for (const auto& num : numbers) {
std::cout << num << " ";
}
return 0;
}