Cod sursa(job #649675)

Utilizator sergiu.marcusMarcus Sergiu sergiu.marcus Data 16 decembrie 2011 15:50:53
Problema Text Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.44 kb
var s,t:string;i,k,c:integer;f,g:text;
begin
assign(f,'text.in');reset(f);
assign(g,'text.out');rewrite(g);
c:=0;k:=0;
while not eof(f) do           begin
read(f,t);s:=s+' ';s:=s+t;end;
for i:=1 to length(s) do begin
if ((s[i]<'A')or(s[i]>'z')or((s[i]>'Z')and(s[i]<'a')))and((s[i+1]>='A')and(s[i+1]<='z')) then inc(k);
if ((s[i]>='A')and(s[i]<='Z'))or((s[i]>='a')and(s[i]<='z')) then inc(c);end;


write(g,c div k);
close(f);close(g);
end.