For printing it out in the same order as the text file put an extra cout << endl; on line 47 (after the inner for loop) so that a new line is created each time u loop through the columns of a row.
There's some bounds that are off by one like line 41 should be for(int i=0; i<=(row); i++);
The other problem u'll notice is that the whitespace on that first line in the text file is not being accounted for and this messes up the whole thing. There's different ways to deal with that, one uses the noskipws manipulator like input >> noskipws; //before while(input) . By doing it with this noskipws u'll have to discard those endline characters or they too will be stored into the array...
*If it's not guaranteed that each line in the text file is exactly 5 chars u'll have to determine when the end of the lines are.