Cod sursa(job #727894)
| Utilizator | Data | 28 martie 2012 12:46:44 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | fpc | Status | done |
| Runda | Arhiva de probleme | Marime | 0.72 kb |
var f:text;
pre,c:char;
flag:boolean;
lit,m:longint;cuv:word;
begin
assign(f,'text.in');
reset(f);
cuv:=0;
flag:=false;
lit:=0;
read(f,c);
while (not eof(f))do
begin
if c in ['a'..'z','A'..'Z'] then begin
inc(lit);
flag:=true;
end
else if flag=true then
begin
inc(cuv);
flag:=false;end;
read(f,c);
if(eof(f)and(flag=true))then cuv:=cuv+1;
end;
close(f);
assign(f,'text.out');
rewrite(f);
if(cuv<>0) then begin
m:=lit div cuv;
write(f,m);
end;
close(f);
end.