I want to use cin>>
in c++ to write the values into a bi-dimensional array on the same line..I don't know English very well but I'll show you an example:
So I have an array and I want to write in it 24 numbers(4 rows, 6 colons) and I want to input all the 6 numbers on the same line not like cin>>
usually does like jumping on a new line.
I got this so far :
int m,n,i,j,a[50][50];
cout<<"Input the number of rows : ";
cin>>n;
cout<<"Input the number of columns : ";
cin>>m;
for(i=0;i<n;i++)
{
for(j=0;j<m;j++)
{
cout<<"Introduceti a["<<i+1<<"]["<<j+1<<"] : ";
cin>>a[i][j];
}
}
But this does the usual jump on a new line every time I input something.
Is that possible?..Thank you! :)
Thank you! :)