Skip to content

Commit

Permalink
合并对难度设置样式的修改
Browse files Browse the repository at this point in the history
提取难度分数函数,对齐难度和提示字样
  • Loading branch information
Mq-b authored Nov 9, 2023
2 parents 83679ec + a014e67 commit da1b717
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 9 deletions.
7 changes: 4 additions & 3 deletions src/PDF版题目与答案/tex/question01.tex
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
1 4 9
\end{tcolorbox}

$\bullet ~ $\textbf{难度}:\ding{72} \ding{72} \ding{73} \ding{73} \ding{73}

$~~~$\textbf{提示}:\mintinline{c++}{T& operator|(T& v, const T& f) }。
\begin{itemize}
\item \textbf{难度}: \hardscore{2} \\
\textbf{提示}:\mintinline{c++}{T& operator|(T& v, const T& f) }。
\end{itemize}
6 changes: 4 additions & 2 deletions src/PDF版题目与答案/tex/question02.tex
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
π:3.141593
\end{tcolorbox}

$\bullet ~ $\textbf{难度}:\ding{72} \ding{72} \ding{73} \ding{73} \ding{73}

$~~~$\textbf{提示}:C++11 用户定义字面量、C++20 format 库。
\begin{itemize}
\item \textbf{难度}: \hardscore{2} \\
\textbf{提示}:C++11 用户定义字面量、C++20 format 库。
\end{itemize}
9 changes: 5 additions & 4 deletions src/PDF版题目与答案/tex/question03.tex
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@
1/10
\end{tcolorbox}

$\bullet ~ $\textbf{难度}:\ding{72} \ding{72} \ding{72} \ding{73} \ding{73}
\begin{itemize}
\item \textbf{难度}: \hardscore{3} \\
\textbf{提示}:std::formatter。
\end{itemize}

$~~~$\textbf{提示}:std::formatter。

禁止面向结果编程,使用宏等等方式,本题主要考察和学习 format 库,记得测试至少三个不同编译器。
禁止面向结果编程,使用宏等等方式,本题主要考察和学习 format 库,记得测试至少三个不同编译器。
14 changes: 14 additions & 0 deletions src/PDF版题目与答案/tex/utility.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

\newcommand{\hardscore}[1]{
\newcount\starcount
\starcount=0
\loop
\ifnum\starcount<5
\ifnum\starcount<#1
\ding{72}
\else
\ding{73}
\fi
\advance\starcount by 1
\repeat
}
2 changes: 2 additions & 0 deletions src/PDF版题目与答案/现代C++题目.tex
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

\date{\today}

\input{tex/utility.tex}

\begin{document}
\maketitle

Expand Down

0 comments on commit da1b717

Please sign in to comment.