Cod sursa(job #1356782)
Utilizator | Andras Stefan Stefan. | Data | 23 februarie 2015 16:23:30 |
---|---|---|---|
Problema | Text | Scor | 50 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.6 kb |
program infoarena1;
var f,g:text;
c:char;
litere,cuvinte:longint;
begin
assign(f,'text.in'); reset(f);
assign(g,'text.out'); rewrite(g);
litere:=0; cuvinte:=0;
while not seekeoln(f) do
begin
read(f,c);
if ((c <= 'z') and (c >= 'a')) or ((c >= 'A') and (c <= 'Z')) then
begin
inc(cuvinte);
while ((c <= 'z') and (c >= 'a')) or ((c >= 'A') and (c <= 'Z')) do
begin
inc(litere);
read(f,c);
end;
end;
end;
writeln(g,litere div cuvinte);
close(f); close(g);
end.