Столько же, во сколько раз отрезок а больше отрезка б.
Там нужен точный ответ или так?)))
<span>{$R+,S+,Q+}</span> uses SysUtils; <span>const R=1000;</span><span>type Mas= array [0..R] of integer;</span>var a: Mas; en,n: integer; x,y,z,q,w: char;<span>function push(n: integer): string;</span>begin<span> a[en]:=n;</span><span> en:=en+1;</span> push:='ok';end;<span>function pop(): integer;</span>begin<span> en:=en-1;</span><span> pop:=a[en];</span><span> a[en]:=0;</span>end;<span>function back(): integer;</span>begin<span> back:=a[en-1];</span>end;<span>function size(): integer;</span>begin size:=en;end;<span>function clear(): string;</span>begin<span> en:=0;</span> clear:='ok';end;<span>function exit(): string;</span>begin exit:='bye';end;begin<span> en:=0;</span> repeat<span> read(x);</span> if x='p' then begin<span> read(y);</span> if y='u' then begin<span> read(z,q,w);</span><span> readln(n);</span><span> writeln(push(n))</span> end else begin<span> readln(z);</span><span> writeln(pop());</span> end; end; if x='b' then begin<span> readln(y,z,q);</span><span> writeln(back());</span> end; if x='s' then begin<span> readln(y,z,q);</span><span> writeln(size());</span> end; if x='c' then begin<span> readln(y,z,q,w);</span><span> writeln(clear());</span> end; if x='e' then begin<span> readln(y,z,q);</span><span> writeln(exit());</span> end; until x='e';<span>end.</span>
Передача перо* дача
можешь нарисовать лучше ;)
Только 112 и 444, другие не подходят, вродь