Cod sursa(job #2361439)

Utilizator VanilieProgramatoareSoltanMarian VanilieProgramatoare Data 2 martie 2019 15:39:04
Problema Text Scor 100
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.89 kb
program aw;
var fin,fout:textfile;
o,c:char;
i,j,k,n:integer;
inCuvant:boolean;

function esteLitera(var c:char):boolean;
begin
if ((ord(c)>=65) and (ord(c)<=90)) or((ord(c)>=97) and (ord(c)<=122)) then esteLitera:=true
else esteLitera:=false;
end;

begin
assign(fin,'text.in');
reset(fin);
assign(fout,'text.out');
rewrite(fout);
inCuvant:=false;
while not eof(fin) do begin
          read(fin,c);
          if esteLitera(c) then begin
                          inc(k);
                          if not inCuvant then begin
                                              inc(n);
                                              inCuvant:=true;
                                              end;
                                              end
                              else inCuvant:=false;
                              end;
write(fout,k div n);
close(fin);
close(fout);
end.