Cod sursa(job #140175)

Utilizator andrici_cezarAndrici Cezar andrici_cezar Data 21 februarie 2008 14:09:59
Problema Text Scor 40
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.44 kb
program p21;
var f,g:text;
    q,c:char;
    r,nrm,nrc:longint;
    ok:boolean;
begin
assign(f,'text.in');reset(f);
assign(g,'text.out');rewrite(g);
nrm:=0;
nrc:=0;
while not eof(f) do
begin
q:=c;
read(f,c);
if q=c then ok:=true
else ok:=false;
if c=' ' then nrc:=nrc+1
 else if c in ['A'..'Z','a'..'z'] then nrm:=nrm+1;
end;
nrc:=nrc+1;
  r:=nrm div nrc;
if ok=true then writeln(g,r+1)
else writeln(g,r);
close(g);
end.