Pagini recente » Cod sursa (job #1446729) | Cod sursa (job #2639170) | Cod sursa (job #3189015) | Cod sursa (job #1470161) | Cod sursa (job #1484707)
program text;
var f1 : textfile;
f2 : textfile;
c:array[1..1000] of char;
i,k,j,n,x,y : integer;
begin
i:=1;
assign(f1,'text.in');
reset(f1);
while not eof(f1) do begin
read(f1,c[i]);
if ((c[i] >='A')and( c[i]<='Z')) or ((c[i] >='a')and (c[i]<='z')) then
inc(k);
inc(i);
end;
close(f1);
for j:=1 to i do begin
if (((c[j] >='A')and( c[j]<='Z')) or ((c[j+1] >='a')and (c[j+1]<='z'))) and (not(((c[j+1] >='A')and( c[j+1]<='Z')) or ((c[j] >='a')and (c[j]<='z')))) then
x:=x+1;
end;
y:=trunc(k/x);
assign(f2,'text.out');
rewrite(f2);
write(f2,y);
close(f2);
readln;
end.