Pagini recente » Cod sursa (job #2240925) | Cod sursa (job #1677870) | Cod sursa (job #2636074) | Cod sursa (job #1412481) | Cod sursa (job #94293)
Cod sursa(job #94293)
program Text1;
const
abc : string = 'abcdefghijklmnoprstuvwxyzABCDEFGHJIKLMNOPRSTUVWXYZ';
var
s, p, p1 : 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 c = ' ' then
WriteLn('spatiu') else
WriteLn(c);
if prezent(c) then
s := s + 1
else
if ((prezent(c1)) and (c = ' ')) or (not eof(Fl)) then
p := p + 1;
end;
Close(Fl);
Assign(Fl,'text.out');
ReWrite(Fl);
WriteLn(Fl,s div p);
Close(Fl);
ReadLn;
end.