Pagini recente » Cod sursa (job #1487025) | Cod sursa (job #1224972) | Cod sursa (job #735020) | Cod sursa (job #183837) | Cod sursa (job #281109)
Cod sursa(job #281109)
var a1,a2:array[1..40] of char;
s,p:char;
x,i,l,c:integer;
f,g:text;
ok,okc:boolean;
begin
assign (f,'text.in');
assign (g,'text.out');
reset (f);
rewrite (g);
x:=0;
for p:='a' to 'z' do
begin
x:=x+1;
a1[x]:=p;
end;
x:=0;
for p:='A' to 'Z' do
begin
x:=x+1;
a2[x]:=p;
end;
l:=0;
c:=0;
okc:=false;
while not(eof(f)) do
begin
read (f,s);
ok:=false;
for i:=1 to x do
if a1[i]=s then
begin
ok:=true;
break;
end;
if ok=false then
begin
for i:=1 to x do
if a2[i]=s then
begin
ok:=true;
break;
end;
if ok=true then
begin
l:=l+1;
okc:=true;
end
else
if okc=true then
begin
c:=c+1;
okc:=false;
end;
end
else
begin
l:=l+1;
okc:=true;
end;
end;
writeln (g,abs(l div c));
close (f);
close (g);
end.