Cod sursa(job #47385)

Utilizator dushmiMihai-Alexandru Dusmanu dushmi Data 3 aprilie 2007 17:24:48
Problema Text Scor 40
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.5 kb
var s:string;
    i,tu,p,n:longint;
    g:set of char;
    t1,t2:text;
begin
assign(t1,'text.in'); reset(t1);
assign(t2,'text.out'); rewrite(t2);
g:=['1'..'9','a'..'z','A'..'Z'];
read(t1,s);
n:=length(s);
i:=1;
if s[i]<>' ' then inc(p);
for i:=1 to n do
    begin
         if not(s[i] in g) then inc(p);
         if (s[i] in g) then inc(tu);
    end;
for i:=1 to n do
    if (s[i]=',') or (s[i]='!') or (s[i]='.') or (s[i]='?') then p:=p-1;
write(t2,tu div p);
close(t1);
close(t2);
end.