Cod sursa(job #1299088)

Utilizator SirbuAlexandruSirbu Alexandru SirbuAlexandru Data 23 decembrie 2014 15:00:09
Problema Text Scor 100
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.39 kb
var
	f:text;
	c,p:char;
	l,n:integer;
begin
	assign(f,'text.in');
	reset(f);
	n:=0;l:=0;p:='.';
	while not eof(f) do begin
		read(f,c);
		if c in ['a'..'z','A'..'Z'] then
			l:=l+1
		else
			if p in ['a'..'z','A'..'Z']
				then n:=n+1;
		p:=c;
	end;
	close(f);
	if c in ['a'..'z','A'..'Z'] then n:=n+1;
	assign(f,'text.out');
	rewrite(f);
	write(f,l div n);
	close(f);
end.