Cod sursa(job #1010033)

Utilizator grisa.din.205Grigore Ciobanu grisa.din.205 Data 14 octombrie 2013 10:26:58
Problema Text Scor 40
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.43 kb
program text1;
var c,s:char;
n,m,med:longint;

f1,f2:text;
begin
assign(f1,'text.in');
assign(f2,'text.out');
reset(f1);
rewrite(f2);
n:=0;
m:=1;
read(f1,c);
s:=' ';
if (c in ['a'..'z']) or (c in ['A'..'Z']) then n:=n+1;
while not eof(f1) do
begin
read(f1,c);
if (c in ['a'..'z']) or (c in ['A'..'Z']) then n:=n+1;
if (c=' ') and (s <> ' ') then m:=m+1;
s:=c;
end;
writeln(f2,n div (m+1));
close(f1);
close(f2);
end.