Var f1:text; f2:text; s1,s2:string; k1,k2:integer; begin; assign(f1,'f1.txt'); reset(f1); while not Eof(f1) do read(f1,s1); close(f1); assign(f2,'f2.txt'); reset(f2); while not Eof(f2) do read(f2,s2); close(f2); while pos(',',s1)<>0 do begin; delete(s1,pos(',',s1),1); inc(k1); end; while pos(',',s2)<>0 do begin; delete(s2,pos(',',s2),1); inc(k2); end; if k1>k2 then writeln('В первом'); if k2>k1 then writeln('Во втором'); if k2=k1 then writeln('Равно'); end.
f2:text;
s1,s2:string;
k1,k2:integer;
begin;
assign(f1,'f1.txt');
reset(f1);
while not Eof(f1) do
read(f1,s1);
close(f1);
assign(f2,'f2.txt');
reset(f2);
while not Eof(f2) do
read(f2,s2);
close(f2);
while pos(',',s1)<>0 do
begin;
delete(s1,pos(',',s1),1);
inc(k1);
end;
while pos(',',s2)<>0 do
begin;
delete(s2,pos(',',s2),1);
inc(k2);
end;
if k1>k2 then writeln('В первом');
if k2>k1 then writeln('Во втором');
if k2=k1 then writeln('Равно');
end.