Cod sursa(job #285548)
| Utilizator | Data | 22 martie 2009 18:20:28 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | fpc | Status | done |
| Runda | Arhiva de probleme | Marime | 0.56 kb |
const litere=['a'..'z','A'..'Z'];
var c:char;
k,con,s:integer;
begin
k:=0;
con:=0;
s:=0;
assign(input,'text.in'); reset(input);
assign(output,'text.out'); rewrite(output);
while not eof do begin
read(c);
if c in litere then begin
inc(con);
if eof then begin s:=s+con; if con>0 then inc(k); end;
end
else begin s:=s+con; if con>0 then inc(k); con:=0; end;
end;
if k=0 then write('0') else
write(s div k);
readln;
close(input); close(output);
end.
