Cod sursa(job #1089117)
Utilizator | Data | 21 ianuarie 2014 15:28:04 | |
---|---|---|---|
Problema | Text | Scor | 20 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 1.59 kb |
Program p1;
var s : string;
i,k,l : longint;
begin
assign(input,'text.in'); reset(input);
assign(output,'text.out'); rewrite(output);
readln(S);
i:=1;
while i<=length(S) do
if not (S[i] in ['a'..'z','A'..'Z','-',' ']) then begin
delete (s,i,1);
i:=i-1;
end
else i:=i+1;
i:=1;
while i<=length(S) do
if (S[i]='-') and (S[i+1]=' ') then begin
delete(s,i,1);
i:=i-1;
end
else i:=i+1;
i:=1;
while i<=length(S) do
if (S[i]=' ') and (S[i+1]=' ') then begin
delete(s,i,1);
i:=i-1;
end
else i:=i+1;
for i:=1 to length(S) do begin
if (S[i]=' ') or (S[i]='-') then l:=l+1;
if S[i] in ['A'..'Z','a'..'z'] then k:=k+1;
end;
writeln(K div l);
close(input);
close(output);
end.