答案1
下一个代码
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[solid,thick] (0,0) -- (6,0);
\draw[thick] (0,0.2) -- ++ (0,-0.4) node[below] {0};
\draw[thick] (2,0.2) -- ++ (0,-0.4) node[below] {$n-k$};
\draw[thick] (6,0.2) -- ++ (0,-0.4) node[below] {$n$};
\end{tikzpicture}
\end{document}
生成: