Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
8
Добавлен:
17.04.2013
Размер:
2.11 Кб
Скачать
program textfile;
uses crt;
const path1 = 'd:\labs\laba3\f1.txt';
path2 = 'd:\labs\laba3\f2.txt';
n = 10;
dl = 10;

var f1,f2: text;
ar1,ar2:array [1..n,1..dl] of char;
i,j,line,poz:integer;
k:char;

begin
textbackground(black);
clrscr;
assign(f1,path1);
assign(f2,path2);
{$I-}
reset(f1);
reset(f2);
{$I+}
if ioresult<>0 then
begin
textcolor(red);
writeln('Љ ЄЁҐ-в® ва Ў«л б д ©« ¬Ё...');
readln;
halt;
end;
i:=1;
j:=1;
while not eof(f1) do
begin
while not eoln(f1) do
begin
read(f1,k);
ar1[i,j]:=k;
j:=j+1;
end;
i:=i+1;
j:=1;
readln(f1);
end;
close(f1);
i:=1;
j:=1;
while not eof(f2) do
begin
while not eoln(f2) do
begin
read(f2,k);
ar2[i,j]:=k;
j:=j+1;
end;
j:=1;
i:=i+1;
readln(f2);
end;
close(f2);
line:=1;
poz:=1;
for i:=1 to n do
begin
for j:=1 to dl do
begin
if ar1[i,j]<>ar2[i,j] then
begin
line:=i;
poz:=j;
break;
end;
end;
end;
if (ar1[1,1]=ar2[1,1]) and (poz=1) and (line=1) then
begin
textcolor(blue);
writeln('” ©«л Ё¤Ґ­вЁз­л!');
readln;
halt;
end;
window(35,5,55,8);
textcolor(green);
writeln(' ‘ва®Є : ',line,' ');
write(' Џ®§ЁжЁп: ',poz,' ');
readln;
end.
Соседние файлы в папке VAR23