Cod sursa(job #470784)

Utilizator robertcrobert ciobotaru robertc Data 15 iulie 2010 15:47:41
Problema Text Scor 30
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.47 kb
program text1;
var t:string;
cuv:array[1..100] of string;
c,i,j,l:integer;
f1,f2:text;
begin
assign(f1,'text.in');reset(f1);
assign(f2,'text.out');rewrite(f2);
read(f1,t);
for i:=1 to length(t) do
t[i]:=upcase(t[i]);
j:=1;
for i:=1 to length(t) do
if (t[i] in ['A'..'Z']) then begin l:=l+1; cuv[j]:=cuv[j]+t[i]; end
                        else j:=j+1 ;
c:=j;
for i:=1 to j do
if length(cuv[i])=0 then c:=c-1;
write(f2,trunc(l/c));
close(f1);
close(f2);
end.