Cod sursa(job #997598)
| Utilizator | Data | 14 septembrie 2013 17:14:40 | |
|---|---|---|---|
| Problema | Text | Scor | 70 |
| Compilator | fpc | Status | done |
| Runda | Arhiva de probleme | Marime | 0.64 kb |
program text1;
var f,g:text;
c:char;
litere,cuvinte:qword;
ok:boolean;
bufin,bufout:array[1..65000] of byte;
begin
assign (f,'text.in'); reset (f);
assign (g,'text.out'); rewrite (G);
settextbuf (f,bufin);
settextbuf (g,bufout);
while not seekeof (f) do
begin
read (f,c);
if ((c>='a') and(c<='z')) or ((c>='A') and(c<='Z')) then
begin
inc(litere); ok:=true;
end
else
if ok then
begin
inc(cuvinte);
ok:=false;
end;
end;
write (g,trunc(litere/cuvinte));
close(f); close (g);
end.
