Pagini recente » Cod sursa (job #894043) | Cod sursa (job #2485884) | Cod sursa (job #1503630) | Cod sursa (job #313610) | Cod sursa (job #678046)
Cod sursa(job #678046)
program text_infoarena;
type sir = array[1..100000] of char;
var a:sir;
i,n:longint;
f:text;
lungime,nr_cuvinte:integer;
begin
assign(f,'text.in'); reset(f);
i:=1;
while not eof(f) do
begin
read(f,a[i]);
inc(i);
end;
close(f);
n:=i-1;
for i:=1 to n do begin
a[i]:=upcase(a[i]);
if not (a[i] in ['A'..'Z','0'..'9']) then a[i]:=' ';
end;
nr_cuvinte:=0;
lungime:=0;
for i:=1 to n do begin
if (a[i] in ['A'..'Z','0'..'9']) then inc(lungime);
if ((a[i] in ['A'..'Z','0'..'9']) and (a[i+1]=' ')) then inc(nr_cuvinte);
end;
writeln (lungime div nr_cuvinte);
readln;
end.