Cod sursa(job #919880)
Utilizator | Filip Ion Dorinel dorinel.filip | Data | 19 martie 2013 21:23:23 |
---|---|---|---|
Problema | Text | Scor | 90 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.69 kb |
var f,g:text;
x:char;
nr,s:longint;
numara:boolean;
begin
nr:=0;
s:=0;
assign(f,'text.in');reset(f);
numara:=false;
while not eof(f) do
begin
read(f,x);
if x in ['A'..'z'] then
numara:=true;
if x in ['A'..'z'] then
s:=s+1
else
if (not(x in ['A'..'z'])) and (numara=true) then
begin
nr:=nr+1;
numara:=false
end
end;
close(f);
if x in ['A'..'z'] then
nr:=nr+1;
assign(g,'text.out');rewrite(g);
write(g,s div nr);
close(g);
end.