Cod sursa(job #153114)

Utilizator nod_softwareBudisteanu Ionut Alexandru nod_software Data 10 martie 2008 10:01:49
Problema Text Scor 40
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.68 kb
program text2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var fin,fout:text;
    i,len,cuv,k,sol:integer;
    c:char;
begin
        assign(fin,'text.in'); reset(fin);
        assign(fout,'text.out'); rewrite(fout);

        len:=0;
        cuv:=0;
        k:=0;

        while not eoln(fin) do
        begin
	        read(fin,c);
	        if (((ord(c)>64) and (ord(c)<91)) or (ord(c)>=97) and (ord(c)<=122)) then
	        begin
                        len:=len+1;
		        if k = 0 then inc(cuv) ;
		        k:=1;
	        end
	        else
	        k:=0;
        end;

	sol:=len div cuv;
        close(fin);
        writeln(fout,sol);
        close(fout);
end.