答案1
像这样吗?
\documentclass{article}
\usepackage{array,booktabs}
\newcommand\ml[1]{\multicolumn{1}{l}{#1}}
\newcommand\lparen{\mkern1mu(\mkern1mu}
\newcommand\rparen{\mkern1mu)\mkern1mu}
\newcommand\pp{\phantom{\lparen}}
\begin{document}
\[
\setlength\arraycolsep{0pt}
\begin{array}{ *{11}{r} }
198 & \rparen & 360 & \lparen & \ml{1} \\
&& 198 & \pp \\
\cmidrule{3-4}
&& 162 & \rparen & 198 & \lparen & \ml{1} \\
&&&& 162 & \pp \\
\cmidrule{5-6}
&&&& 36 & \rparen & 162 & \lparen & \ml{4} \\
&&&&&& 144 & \pp \\
\cmidrule{7-8}
&&&&&& 18 & \rparen & 36 & \lparen & \ml{2} \\
&&&&&&&& 36 & \pp\\
\cmidrule{9-10}
&&&&&&&& \multicolumn{2}{c}{\times}
\end{array}
\]
\end{document}
答案2
这是执行宏递归的典型例子:
\def\divi #1)#2/#3=#4{#1)%
\vtop{\hbox{#2}\hbox{#3}\smallskip\hrule width1.5em\smallskip\hbox{#4}}}
\def\0{\phantom0}
\divi 198)360(1/190={%
\divi 162)198(1/162={%
\divi \036)162(4/144={%
\divi \018)36(2/36={%
$\0\times$}}}}
\bye