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. մϴ.
ΰ ũθ غ 67 11.5 ذǴ ڽϴ. ణ ȭ ϸ, ϴ. \demobox ũθ ϴµ,
ϸ ũԴϴ.
캸ø, 켱 ܾ óϰ, ܾ ڸ ڽ ָ Ǵ Դϴ. ΰ ũ \fifo...\ofif \fifow...\wofif Ǵ Դϴ. \process \processw ϸ ذǴµ, ̶ ڸ óϴ \process
ڸ ѷδ ڽ ̰, \processw ־ ڿ ܾ \fifo#1\ofif ȣϸ ˴ϴ. , ܾ ڽ ũθ ȣϸ Ǵ Դϴ. !!!
ҽ ϴ. (
DohyunKim ֽ Ͱ ֽ ذå ҽ Ϻ Ͽϴ.)
\def\fifo#1{\ifx\ofif#1\ofif\fi
\process#1\fifo}
\def\ofif#1\fifo{\fi}
\def\fifow#1 {\ifx\wofif#1\wofif\fi
\processw{#1}\ \fifow}
\def\wofif#1\fifow{\fi}
\def\processw#1{\fifo#1\ofif}
\def\process#1{\boxit#1}
\def\boxit#1{\setbox0=\hbox{#1}
\hbox{\lower\dp0
\vbox{\offinterlineskip\hrule
\hbox{\vrule\phantom#1\vrule}\hrule}
}
}
\def\demobox#1{\leavevmode\fifow #1 \wofif \unskip{} }
\demobox{Tough exercise}
ణ ȭ ϱ , Knuth ش亸 ȮϽ Դϴ.
LIFO ũ \lifo...\ofil ϸ ɱ? غ.
Ʈ: \fifo...\ofif ݸ ٲٸ ˴ϴ. \process ϴİ Դϴ.