Program Pr1; uses crt; var stroka,stroka1:string; i,b,c,a:integer; mas:array['A'..'я'] of integer; r:char; Begin clrscr; readln(stroka); readln(stroka1); b:=length(stroka); c:=length(stroka1); if b>c then begin for i:=1 to c do for a:=1 to b do if stroka[a]=stroka1[i] then mas[stroka1[i]]:=mas[stroka1[i]]+1; end else begin for i:=1 to b do for a:=1 to c do if stroka1[a]=stroka[i] then mas[stroka[i]]:=mas[stroka[i]]+1; end; for r:='A' to 'я' do if mas[r]>0 then writeln(r,' ',mas[r]); end.
Program Pr1;
uses crt;
var stroka,stroka1:string;
i,b,c,a:integer;
mas:array['A'..'я'] of integer;
r:char;
Begin
clrscr;
readln(stroka);
readln(stroka1);
b:=length(stroka);
c:=length(stroka1);
if b>c then begin
for i:=1 to c do
for a:=1 to b do if stroka[a]=stroka1[i] then mas[stroka1[i]]:=mas[stroka1[i]]+1;
end
else begin
for i:=1 to b do
for a:=1 to c do if stroka1[a]=stroka[i] then mas[stroka[i]]:=mas[stroka[i]]+1;
end;
for r:='A' to 'я' do if mas[r]>0 then writeln(r,' ',mas[r]);
end.