Cod sursa(job #588611)

Utilizator sharky12592Sireanu Roland sharky12592 Data 8 mai 2011 20:03:00
Problema Text Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.66 kb
Program parsare ;
var F,FF:text;
	S:string;
       ma, l,cuvinte,litere,i:integer;
Procedure stop;
Begin
        if l>0 then
           Begin
                inc(cuvinte);
                l:=0;
           end;
End;

Begin
litere:=0; cuvinte:=0;  l:=0;
Assign(F,'text.in');
Reset(F);
while not(Eof(F)) DO
Read(F,S);
Close(F);
For i:=1 to length(s) Do
	If ((s[i] in ['a'..'z']) or (s[i] in ['A'..'Z'])) then
	        inc(litere);

For i:=1 to length(s) do
        If (s[i] in ['a'..'z']) or (s[i] in ['A'..'Z']) then
                inc(l)
                else stop;
ma:=litere DIV cuvinte ;
Assign(FF,'text.out');
writeln(FF,ma);
Close(FF);
End.