Cod sursa(job #726829)
Utilizator | Data | 27 martie 2012 15:48:08 | |
---|---|---|---|
Problema | Text | Scor | 50 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
var f:text;
cl,cc:longint;
mid:longint;
c:char;
const ALPHA = ['A'..'Z', 'a'..'z'];
begin
cl:=0;
cc:=0;
assign(f, 'text.in');
reset(f);
while EOF(f) = false do begin
read(f, c);
if c in ALPHA then
cl:=cl+1;
if c = ' ' then
cc:=cc+1;
end;
close(f);
assign(f, 'text.out');
rewrite(f);
cc:=cc+1;
mid:=Trunc(cl/cc);
write(f, mid);
close(f);
end.