program createTextDocument;
vartextDocument: text;i, j, N, M: integer;
beginassign(textDocument, 'text_document.txt');rewrite(textDocument);
writeln('Enter the number of lines (N): ');readln(N);writeln('Enter the number of characters in each line (M): ');readln(M);
for i := 1 to N dobeginfor j := 1 to M dobeginwrite(textDocument, j mod 10);end;writeln(textDocument);end;
close(textDocument);writeln('Text document has been created.');end.
program createTextDocument;
var
textDocument: text;
i, j, N, M: integer;
begin
assign(textDocument, 'text_document.txt');
rewrite(textDocument);
writeln('Enter the number of lines (N): ');
readln(N);
writeln('Enter the number of characters in each line (M): ');
readln(M);
for i := 1 to N do
begin
for j := 1 to M do
begin
write(textDocument, j mod 10);
end;
writeln(textDocument);
end;
close(textDocument);
writeln('Text document has been created.');
end.