I need write a function that takes an array of integers and its size as parameters and fill this vector with random numbers in the range 1 to the size of the vector without repetition. help me please
#include <vector>
#include <iostream>
int main()
{
int i = 0;
std::vector<int> x;//Declare a vector of integers.
x.push_back(5);//Add the number 5 to the vector.
std::cout << x.size() << "\n"; //Output the current size of the vector.
x.push_back(19);//Add the number 19 to the vector.
std::cout << x.size() << "\n";//Output the current size of the vector (it now has two elements in).
for(i = 0;i < 10;++i)//Put 10 more elements in the vector, from 1-10.
{
x.push_back(i + 1);
}
std::cout << x.size() << "\n"; //Output the current size of the vector (which is now 12).
std::cout << "The elements stored in vector x are: \n";
for(i = 0;i < x.size(); ++i)
{
std::cout << x.at(i) << "\n"; //Output the value of each element held within the vector.
}
return 0;
}