#include
#include
using namespace std;
int main()
{
vector v;
int i,n,j,k;
cin>>n;
for(i=0;i<n;i++)
{
cin>>v[i];
}
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
for(k=i;k<=j;k++)
{
cout<<v[k]<<" ";
}
cout<<endl;
}
}
return 0;
}
is there something wrong if i try to enter values in vector using index??beacuse my code worked fine when i used the push_back() function