Cod sursa(job #175132)
| Utilizator | Data | 9 aprilie 2008 16:48:50 | |
|---|---|---|---|
| Problema | Text | Scor | 30 |
| Compilator | fpc | Status | done |
| Runda | Arhiva de probleme | Marime | 0.71 kb |
Program texte;
var s: string;
nc,nt,q,i: longint;
t,f: text;
Begin
assign(t,'text.in'); reset(t);
read(t,s);
close(t);
nc:=0;
nt:=0;
q:=0;
for i:=1 to length(s) do
begin
if s[i] in ['a'..'z']+['A'..'Z'] then begin
q:=1;
nt:=nt+1;
end
else if q<>0 then
begin
nc:=nc+1;
end;
end;
if s[length(s)] in ['a'..'Z'] then nc:=nc+1;
if (q=1) and (nc=0) then nc:=1;
assign(f,'text.out'); rewrite(f);
write(f,nt div nc);
close(f);
end.
