diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/probsoln/samples/prob-verb.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/probsoln/samples/prob-verb.tex | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/probsoln/samples/prob-verb.tex b/Master/texmf-dist/doc/latex/probsoln/samples/prob-verb.tex new file mode 100644 index 00000000000..07e0f835134 --- /dev/null +++ b/Master/texmf-dist/doc/latex/probsoln/samples/prob-verb.tex @@ -0,0 +1,28 @@ +\begin{defproblem}{code-helloworld} +This problem has a code fragment. +\begin{onlyproblem} +\lstset{language=Java} +\begin{lstlisting} +public class HelloWorld +{ + public static void main(String[] args) + { + System.out.println("Hello World!"); + } +} +\end{lstlisting} +\end{onlyproblem} +\begin{onlysolution} +\lstset{language=Java} +\begin{lstlisting} +public class HelloWorld +{ + public static void main(String[] args) + { + System.out.println("Hello " + + (args.length==0 ? "anon" : args[0])+"!"); + } +} +\end{lstlisting} +\end{onlysolution} +\end{defproblem} |