Pagini recente » Cod sursa (job #1344746) | Cod sursa (job #1524894) | Cod sursa (job #702197) | Cod sursa (job #2366070) | Cod sursa (job #130810)
Cod sursa(job #130810)
var k,c:longint;
m:set of char;
f,g:text;
p:boolean;
uc,ch:char;
begin
assign(f,'text.in');
reset(f);
assign(g,'text.out');
rewrite(g);
c:=0;
k:=0;
m:=['A'..'Z']+['a'..'z'];
p:=false;
uc:=#0;
ch:=#0;
while not seekeof(f) do
begin
uc:=ch;
while not eoln(f) do begin
read(f,ch);
if ch in m then begin
inc(k);
p:=True;
end
else
if p then begin
inc(c);
p:=False;
end;
end;
if (ch in m) and Not (uc in m) then begin
inc(c);
p:=False;
end;
readln(f);
end;
if (k=0) Or (c=0) then write(g,0)
else write(g,k div c);
close(f);
close(g);
writeln('k=',k);
writeln('c=',c);
writeln('k div c=',k div c);
end.