Pagini recente » Cod sursa (job #2701165) | Cod sursa (job #942060) | Cod sursa (job #1350904) | Cod sursa (job #164153) | Cod sursa (job #559681)
Cod sursa(job #559681)
Program text1;
var f:text;
n,i,x:integer;
s:string;
begin
n:=0;
x:=1;
assign(f,'text.in');reset(f);
While not eof(f) do begin
readln(f,s);
n:=n+length(s);
For i:=1 to length(s) do begin
If (s[i]=' ')and((s[i-1] in ['a'..'z'])or(s[i+1] in ['a'..'z'])or(s[i+1] in ['A'..'Z'])or(s[i-1]in['A'..'Z'])) then x:=x+1;
If (s[i]<'A')or(s[i]>'z') then n:=n-1;
end;
end;
assign(f,'text.out');rewrite(f);
writeln(f,n div x);
close(f);
end.