Cod sursa(job #41810)
Utilizator | Serban Andrei Stan savim | Data | 28 martie 2007 16:36:18 |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 kb |
var f1,f2:text;
t:string;
lc,nc,i:longint;
begin
assign(f1,'text.in');
assign(f2,'text.out');
reset(f1);
rewrite(f2);
readln(f1,t);
nc:=0;lc:=0;
for i:=1 to length(t) do
begin
if (((t[i]>='a') and (t[i]<='z')) or ((t[i]>='A') and (t[i]<='Z'))) and
((t[i-1]<'A') or ((t[i-1]>'Z') and (t[i-1]<'a')) or (t[i-1]>'z')) then nc:=nc+1;
if ((t[i]>='a') and (t[i]<='z')) or ((t[i]>='A') and (t[i]<='Z')) then lc:=lc+1;
end;
writeln(f2,lc div nc);
close(f1);
close(f2);
end.