Negative days completion.
This commit is contained in:
13
section/abs.tex
Normal file
13
section/abs.tex
Normal file
@@ -0,0 +1,13 @@
|
||||
\section{演習課題 2}
|
||||
|
||||
整数値を読み込み、その絶対値を出力するプログラム。
|
||||
|
||||
\subsection{コードリスティング}
|
||||
|
||||
\lstinputlisting[language=C,title={演習課題 2}]{../programs/abs/main.c}
|
||||
|
||||
\subsection{実行結果}
|
||||
|
||||
\begin{center}
|
||||
\includegraphics[width=\textwidth]{./assets/abs.png}
|
||||
\end{center}
|
||||
@@ -1,70 +1,12 @@
|
||||
\section{はじめに}
|
||||
|
||||
Start Writing!
|
||||
\subsection{実行環境}
|
||||
|
||||
Use lualatex + biber to compile.
|
||||
この課題のプログラムは以下の環境で動作することが確認されている:
|
||||
|
||||
Test Bib\cite{example}
|
||||
|
||||
いろはにほへと ちりぬるを
|
||||
|
||||
{\gtfamily \sffamily \LaTeX で自由な組版を。}
|
||||
|
||||
{\gtfamily \sffamily Write freely with \LaTeX{}.}
|
||||
|
||||
{\ttfamily LaTeX shall be free forever!}
|
||||
|
||||
\noindent
|
||||
この行のテキストは四十二字です。ああああああああああああああああああああああああああいいいい
|
||||
|
||||
\defaultlistingstyle
|
||||
|
||||
\begin{lstlisting}[language=C, caption=Basic Hello World]
|
||||
#include <stdlib.h>
|
||||
|
||||
int square(int n) {
|
||||
return n*n;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
char* msg = "Hello World";
|
||||
int x = 3;
|
||||
int y = square(x);
|
||||
printf("%s\n", msg);
|
||||
printf("f(x) = x^2; x: %d, y: %d\n", x, y);
|
||||
return 0;
|
||||
}
|
||||
\end{lstlisting}
|
||||
|
||||
\begin{displaymath}
|
||||
\int_{a}^{b} f(x) \,dx = F(b)-F(a)
|
||||
\end{displaymath}
|
||||
|
||||
\begin{itemize}
|
||||
\item C
|
||||
\item Python
|
||||
\item Javascript
|
||||
\item Rust
|
||||
\item Haskell
|
||||
\item OS: NixOS 25.05 (Warbler)
|
||||
\item CPU アーキテクチャ: \texttt{x86\_64}
|
||||
\item C コンパイラ: \texttt{gcc バージョン 14.2.1 20250322 (GCC)}
|
||||
\item C コンパイラオプション: \texttt{-Wall <ソースコード名> -o <実行ファイル名>}
|
||||
\end{itemize}
|
||||
|
||||
\begin{enumerate}
|
||||
\item lualatex <filename>.tex
|
||||
\item biber <filename>
|
||||
\item lualatex <filename>.tex
|
||||
\item lualatex <filename>.tex
|
||||
\end{enumerate}
|
||||
|
||||
\newpage
|
||||
|
||||
\section{Section}
|
||||
|
||||
section
|
||||
|
||||
\subsection{Sub Section}
|
||||
|
||||
sub section
|
||||
|
||||
\paragraph{Paragraph}
|
||||
|
||||
paragraph
|
||||
|
||||
13
section/lst33.tex
Normal file
13
section/lst33.tex
Normal file
@@ -0,0 +1,13 @@
|
||||
\section{演習課題 1 List 3-3}
|
||||
|
||||
5の倍数判定プログラム
|
||||
|
||||
\subsection{コードリスティング}
|
||||
|
||||
\lstinputlisting[language=C,title={演習課題 1 List 3-3}]{../programs/lst33/main.c}
|
||||
|
||||
\subsection{実行結果}
|
||||
|
||||
\begin{center}
|
||||
\includegraphics[width=\textwidth]{./assets/lst33.png}
|
||||
\end{center}
|
||||
13
section/lst34.tex
Normal file
13
section/lst34.tex
Normal file
@@ -0,0 +1,13 @@
|
||||
\section{演習課題 1 List 3-4}
|
||||
|
||||
偶数奇数判定プログラム
|
||||
|
||||
\subsection{コードリスティング}
|
||||
|
||||
\lstinputlisting[language=C,title={演習課題 1 List 3-4}]{../programs/lst34/main.c}
|
||||
|
||||
\subsection{実行結果}
|
||||
|
||||
\begin{center}
|
||||
\includegraphics[width=\textwidth]{./assets/lst34.png}
|
||||
\end{center}
|
||||
13
section/lst35.tex
Normal file
13
section/lst35.tex
Normal file
@@ -0,0 +1,13 @@
|
||||
\section{演習課題 1 List 3-5}
|
||||
|
||||
非ヌル判定プログラム
|
||||
|
||||
\subsection{コードリスティング}
|
||||
|
||||
\lstinputlisting[language=C,title={演習課題 1 List 3-5}]{../programs/lst35/main.c}
|
||||
|
||||
\subsection{実行結果}
|
||||
|
||||
\begin{center}
|
||||
\includegraphics[width=\textwidth]{./assets/lst35.png}
|
||||
\end{center}
|
||||
13
section/lst36.tex
Normal file
13
section/lst36.tex
Normal file
@@ -0,0 +1,13 @@
|
||||
\section{演習課題 1 List 3-6}\label{lst36}
|
||||
|
||||
2つの整数値の等価検証プログラム
|
||||
|
||||
\subsection{コードリスティング}
|
||||
|
||||
\lstinputlisting[language=C,title={演習課題 1 List 3-6}]{../programs/lst36/main.c}
|
||||
|
||||
\subsection{実行結果}
|
||||
|
||||
\begin{center}
|
||||
\includegraphics[width=\textwidth]{./assets/lst36.png}
|
||||
\end{center}
|
||||
15
section/lst37.tex
Normal file
15
section/lst37.tex
Normal file
@@ -0,0 +1,15 @@
|
||||
\section{演習課題 1 List 3-7}
|
||||
|
||||
2つの整数値の等価検証プログラム
|
||||
|
||||
\ref{lst36}の条件を否定に変更したプログラム。
|
||||
|
||||
\subsection{コードリスティング}
|
||||
|
||||
\lstinputlisting[language=C,title={演習課題 1 List 3-7}]{../programs/lst37/main.c}
|
||||
|
||||
\subsection{実行結果}
|
||||
|
||||
\begin{center}
|
||||
\includegraphics[width=\textwidth]{./assets/lst37.png}
|
||||
\end{center}
|
||||
13
section/lst38.tex
Normal file
13
section/lst38.tex
Normal file
@@ -0,0 +1,13 @@
|
||||
\section{演習課題 1 List 3-8}
|
||||
|
||||
整数値の最下位桁判定プログラム
|
||||
|
||||
\subsection{コードリスティング}
|
||||
|
||||
\lstinputlisting[language=C,title={演習課題 1 List 3-8}]{../programs/lst38/main.c}
|
||||
|
||||
\subsection{実行結果}
|
||||
|
||||
\begin{center}
|
||||
\includegraphics[width=\textwidth]{./assets/lst38.png}
|
||||
\end{center}
|
||||
23
section/syntax.tex
Normal file
23
section/syntax.tex
Normal file
@@ -0,0 +1,23 @@
|
||||
\section{今回の構文}
|
||||
|
||||
\subsection{\texttt{if}文}
|
||||
|
||||
プログラムに条件分岐を与える。最も基本的な制御構文。
|
||||
|
||||
\defaultlistingstyle
|
||||
\begin{lstlisting}[language=C,title={\texttt{if}文}]
|
||||
// 式は整数値に評価される。0を偽、それ以外を真としている。
|
||||
if (<式>) {
|
||||
<文(真)> // 文が1つの場合、カーリーブレースを省略できる
|
||||
...
|
||||
}
|
||||
|
||||
if (<式>) {
|
||||
<文(真)> // 文が1つの場合、カーリーブレースを省略できる
|
||||
...
|
||||
} else {
|
||||
<文(偽)> // 文が1つの場合、カーリーブレースを省略できる
|
||||
...
|
||||
}
|
||||
\end{lstlisting}
|
||||
|
||||
Reference in New Issue
Block a user