Pagini recente » Cod sursa (job #2607717) | Cod sursa (job #946402) | Cod sursa (job #1170676) | Cod sursa (job #460863) | Cod sursa (job #110737)
Cod sursa(job #110737)
program Text1;
label
999;
const
abc : string = 'abcdefghijklmnoprstuvwxyzABCDEFGHJIKLMNOPRSTUVWXYZ';
var
s, p, p1, i : longint;
c, c1 : char;
Fl : text;
a : string;
function cuvint(s:string):boolean;
begin
cuvint := false;
for i := 1 to length(s) do
if not (pos(s[i],abc) > 0) then
Exit;
cuvint := true;
end;
begin
Assign(Fl,'text.in');
Reset(Fl);
p := 0;
s := 0;
Read(Fl,c);
if pos(c,abc) > 0 then
a := c;
while not eof(Fl) do
begin
c1 := c;
Read(Fl,c);
if (not (pos(c,abc) > 0)) and (pos(c1,abc) > 0) then
begin
Read(fl,c1);
if c = ' ' then
begin
if cuvint(a) then
begin
p := p + 1;
s := s + length(a);
writeln(a);
end;
a := '';
end;
end
else
a := a + c;
end;
Close(Fl);
Assign(Fl,'text.out');
ReWrite(Fl);
WriteLn(Fl,s div p);
Close(Fl);
readln;
end.