44 lines
1.3 KiB
TeX
44 lines
1.3 KiB
TeX
\documentclass[xelatex,a4paper,11pt,ja=standard]{bxjsarticle}
|
|
|
|
\usepackage{preamble}
|
|
\usepackage{simple-title}
|
|
|
|
\reportauthor{柴田 健琉}
|
|
\reporttitle{情報処理2 - 後期第1回課題}
|
|
\reportdate{2026年}{10月}{05日}
|
|
\turnindate{2026年}{10月}{12日}
|
|
|
|
\begin{document}
|
|
\simpletitle
|
|
|
|
\section{はじめに}
|
|
|
|
この課題のプログラムは以下の環境での動作が確認されている:
|
|
|
|
\begin{itemize}
|
|
\item{OS: NixOS 26.05 Yarara, Linux 7.2.8 x86\_64}
|
|
\item{CC: GCC 16.2.0}
|
|
\item{CFLAGS: \texttt{-g -O2 -Wall -Wpedantic -lm}}
|
|
\end{itemize}
|
|
|
|
\section{課題}
|
|
|
|
教科書のList 12-9を書き換え, 目標地点の絶対座標を指定する方法と目標地点までの相対距離を指定する方法を選択できるようにしたプログラム.
|
|
|
|
\lstinputlisting[language=C, caption={Modifiled List 12-9}]{./prog/a1.c}
|
|
|
|
\subsection{実行結果}
|
|
|
|
\begin{figure}[H]
|
|
\includegraphics[width=12cm]{./prog/res.png}
|
|
\end{figure}
|
|
|
|
\subsection{おおまかな変更点}
|
|
|
|
\begin{itemize}
|
|
\item{列挙体と\texttt{switch}文を用いた距離の指定方法の変更}
|
|
\item{実行環境による\texttt{scanf}関数の誤動作を抑制する\texttt{getchar}関数の追加}
|
|
\end{itemize}
|
|
\end{document}
|
|
|