How can data index in a Vector

#include <iostream>
#include <vector>
using namespace std;
int main()
{
    int i=0;
    vector <int> j(10,i);
    for(i=0;i<10;i++)
    {
            cin>>j[i];
    }
    for(i=0;i<10;i++)
    {
            cout<<j[i]<<endl;
    }
    system("pause");
    return 0;
}


0 comments:

Post a Comment