Answer:
In C++:
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
using namespace std;
int main(){
vector<int> vectItems;
cout << "Vector length: ";
int ln; cin>>ln;
int num;
for (int ikk = 0; ikk < ln; ikk++){
cin >> num;
vectItems.push_back(num);}
int small, secsmall;
small = secsmall = INT_MAX;
for (int ikk = 0; ikk < ln; ikk++){
if(vectItems[ikk] < small){
secsmall = small;
small = vectItems[ikk]; }
else if (vectItems[ikk] < secsmall && vectItems[ikk] != small) {
secsmall = vectItems[ikk];} }
cout<<small<<" "<<secsmall;
return 0;}
Explanation:
See attachment for program file where comments are used for explanation