I'm pretty new to c++ and can't seem to find correct way to code this. I have array of n digits, my code now:
int main()
{
    int n,i;
    cin >> n;
    int a[n];
    for (i=1;i<=n;i++)
    {
        cin >> a[i];
    }
    return 0;
}
This way every element of array has to be input in different line, is it possible to put all elements of a array in one line, with space between them.
 
     
     
     
    
 
    