// reading a text file
#define WIDTH 10
#define HEIGHT 9
#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main(void) {
	char text[WIDTH * HEIGHT];
	string line;
	ifstream myfile("text.txt");
	if (myfile.is_open())
	{
		int count = 0;
		while (getline(myfile, line))
		{
			cout << line << endl;


			line.copy(&text[WIDTH * count], WIDTH, 0);
			count++;
		}
		myfile.close();
	}
	else cout << "Unable to open file";

	cout << endl << endl << endl;

	for (int y = 0; y < HEIGHT; y++)
	{
		for (int x = 0; x < WIDTH; x++)
		{
			cout << text[WIDTH * y + x];
		}
		cout << endl;
	}
	return 0;
}