Cod sursa(job #140181)

Utilizator mironalex2005Alexandru Miron mironalex2005 Data 21 februarie 2008 14:42:36
Problema Cifra Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.57 kb
program p21;
var f,g:text;
    p,c:char;
    t,nrm,nrc,r:longint;
    ok:boolean;
begin
assign(f,'text.in');reset(f);
assign(g,'text.out');rewrite(g);
nrm:=0;
nrc:=0;

read(f,p);
if p in ['A'..'Z','a'..'z'] then begin
                                 nrm:=1;
                                 nrc:=1;
                                 end;

while not eof(f) do
begin
read(f,c);
if (c in ['A'..'Z','a'..'z']) and not (p in ['A'..'Z','a'..'z']) then nrc:=nrc+1;
if c in ['A'..'Z','a'..'z'] then nrm:=nrm+1;
p:=c;
end;
r:=nrm div nrc;
writeln(g,r);
close(g);
end.