Cod sursa(job #1010035)
Utilizator | Grigore Ciobanu grisa.din.205 | Data | 14 octombrie 2013 10:30:56 |
---|---|---|---|
Problema | Text | Scor | 30 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
program text1;
var c,s:char;
n,m: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 ['0'..'9']) then n:=n+1;
while not eof(f1) do
begin
read(f1,c);
if (c in ['a'..'z']) or (c in ['0'..'9']) 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.