diff --git a/document.yaml b/document.yaml index 12414f1..abbc4ee 100644 --- a/document.yaml +++ b/document.yaml @@ -12,7 +12,7 @@ date: turnin: year: 令和7年 month: 07月 - day: 03日 + day: 08日 school_name: 岐阜工業高等専門学校 department: 電子制御工学科 @@ -32,7 +32,7 @@ paper_config: sections: - { path: 'section/introduction.tex', newpg: false } - - { path: 'section/syntax.tex', newpg: true } + - { path: 'section/syntax.tex', newpg: false } - { path: 'section/p41.tex', newpg: true } - { path: 'section/p42.tex', newpg: true } - { path: 'section/p43.tex', newpg: true } diff --git a/main.tex b/main.tex index 53edf83..97ca324 100644 --- a/main.tex +++ b/main.tex @@ -5,7 +5,7 @@ \studentid{2024D14} \seatingnum{15} \reportdate{令和7年}{07月}{03日} -\turnindate{令和7年}{07月}{03日} +\turnindate{令和7年}{07月}{08日} \schoolname{岐阜工業高等専門学校} \department{電子制御工学科} \subject{情報処理I} @@ -23,7 +23,6 @@ \input{section/introduction.tex} \input{section/syntax.tex} - \newpage \input{section/p41.tex} \newpage diff --git a/output/main.pdf b/output/main.pdf index 64fac0a..798b6fc 100644 Binary files a/output/main.pdf and b/output/main.pdf differ diff --git a/section/p41.tex b/section/p41.tex index 0e9fbae..35575cb 100644 --- a/section/p41.tex +++ b/section/p41.tex @@ -1,6 +1,6 @@ \section{課題1} -教科書の演習4ー1の解答 +教科書の演習4-1の解答 \subsection{コードリスティング} diff --git a/section/p42.tex b/section/p42.tex index b61fe6f..acc86c9 100644 --- a/section/p42.tex +++ b/section/p42.tex @@ -1,6 +1,6 @@ \section{課題2} -教科書の演習4ー2の解答 +教科書の演習4-2の解答 \subsection{コードリスティング} diff --git a/section/p43.tex b/section/p43.tex index a6cabb1..1f3ae5f 100644 --- a/section/p43.tex +++ b/section/p43.tex @@ -1,6 +1,6 @@ \section{課題3} -教科書の演習4ー3の解答 +教科書の演習4-3の解答 \subsection{コードリスティング} diff --git a/section/p44.tex b/section/p44.tex index 7b378cb..2f4a1b6 100644 --- a/section/p44.tex +++ b/section/p44.tex @@ -1,6 +1,6 @@ \section{課題4} -教科書の演習4ー4の解答 +教科書の演習4-4の解答 \subsection{コードリスティング} diff --git a/section/syntax.tex b/section/syntax.tex index 839e935..6ff6b1a 100644 --- a/section/syntax.tex +++ b/section/syntax.tex @@ -10,3 +10,25 @@ while (<条件式>) { 文...; } \end{lstlisting} + +\subsection{複合演算子} + +C言語ではよく使用される演算子とその演算子を使った処理を手短に記述できるものがある。それらの中にはインクリメント・デクリメントがある。 + +式の評価後の値に応じて後置演算子、前置演算子と呼ばれる。 + +後置演算子は変数の後に演算子を置くことで、評価すると演算が適用される直前の値が返ってくる。 + +前置演算子はその逆で、変数の前に演算子を置き、評価すると演算が適用された後の値が返ってくる。 + +\begin{lstlisting}[language=C,title={\texttt{後置・前置演算子}}] +int i = 3; +int j = 0; + +j = i++; // j = 3, i = 4 +j = i--; // j = 4, i = 3 + +j = ++i; // j = 4, i = 4 +j = --i; // j = 3, i = 3 +\end{lstlisting} +