#include <iostream>
using namespace std;
int main()
{
int num;
int *vetor = NULL; // vetor que será alocado o espaço
cout << "Digite o tamanho do vetor: \n";
cin >> num;
vetor = new int[num];
int i;
cout << "Digite os elementos do vetor: ";
for(i=0;i<num;i++){
cin >> vetor[i];
}
cout << endl;
cout << "Digite os números " << i << ": ";
for(i=0;i<num;i++) {
cout << vetor[i] << endl;
}
delete [] vetor; // Libera o espaço alocado para o vetor
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCmludCBtYWluKCkKewogICAgaW50IG51bTsgCiAgICBpbnQgKnZldG9yID0gTlVMTDsgLy8gdmV0b3IgcXVlIHNlcsOhIGFsb2NhZG8gbyBlc3Bhw6dvCiAKICAgIGNvdXQgPDwgIkRpZ2l0ZSBvIHRhbWFuaG8gZG8gdmV0b3I6IFxuIjsKICAgIGNpbiA+PiBudW07CiAKICAgIHZldG9yID0gbmV3IGludFtudW1dOwogCiAgICBpbnQgaTsKIAogICAgY291dCA8PCAiRGlnaXRlIG9zIGVsZW1lbnRvcyBkbyB2ZXRvcjogIjsgCiAgICBmb3IoaT0wO2k8bnVtO2krKyl7CiAgICAgCWNpbiA+PiB2ZXRvcltpXTsgCiAgICB9CiAKICAgIGNvdXQgPDwgZW5kbDsKICAgIGNvdXQgPDwgIkRpZ2l0ZSBvcyBuw7ptZXJvcyAiIDw8IGkgPDwgIjogIjsgCiAKICAgIGZvcihpPTA7aTxudW07aSsrKSB7CiAgICAgICBjb3V0IDw8IHZldG9yW2ldIDw8IGVuZGw7CiAgICB9CiAKICAgIGRlbGV0ZSBbXSB2ZXRvcjsgIC8vIExpYmVyYSBvIGVzcGHDp28gYWxvY2FkbyBwYXJhIG8gdmV0b3IKICAgIHJldHVybiAwOyAKfQ==