Pagini recente » Cod sursa (job #2163252) | Cod sursa (job #2111950) | Cod sursa (job #2741992) | Cod sursa (job #2559404) | Cod sursa (job #588611)
Cod sursa(job #588611)
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.