Pagini recente » Cod sursa (job #1799764) | Cod sursa (job #105835) | Cod sursa (job #156009) | Cod sursa (job #1243196) | Cod sursa (job #90889)
Cod sursa(job #90889)
program Text1;
const
abc : string = 'abcdefghijklmnoprstuvwxyzABCDEFGHJIKLMNOPRSTUVWXYZ';
var
s, p, k : longint;
c, c1 : char;
Fl : text;
function prezent(in1: char): boolean;
var
i : longint;
begin
prezent := false;
for i := 1 to length(abc) do
if abc[i] = in1 then
begin
prezent := true;
Exit;
end;
end;
begin
Assign(Fl,'text.in');
Reset(Fl);
p := 0;
s := 0;
Read(Fl,c);
if prezent(c) then
s := 1;
while not eof(Fl) do
begin
c1 := c;
Read(Fl,c);
if prezent(c) then
s := s + 1
else
if prezent(c1) then
p := p + 1;
end;
Close(Fl);
Assign(Fl,'text.out');
ReWrite(Fl);
WriteLn(Fl,s div p);
Close(Fl);
end.