diff --git a/README.md b/README.md index 03caad5..2cf06fe 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,3 @@ -# CHANGEME +# information-processing-1_6th-class +Assignment for 6th class of Information Processing I. diff --git a/assets/abs.png b/assets/abs.png new file mode 100644 index 0000000..7869a20 Binary files /dev/null and b/assets/abs.png differ diff --git a/assets/lst33.png b/assets/lst33.png new file mode 100644 index 0000000..f734f98 Binary files /dev/null and b/assets/lst33.png differ diff --git a/assets/lst34.png b/assets/lst34.png new file mode 100644 index 0000000..3a2346b Binary files /dev/null and b/assets/lst34.png differ diff --git a/assets/lst35.png b/assets/lst35.png new file mode 100644 index 0000000..15ff09d Binary files /dev/null and b/assets/lst35.png differ diff --git a/assets/lst36.png b/assets/lst36.png new file mode 100644 index 0000000..968776e Binary files /dev/null and b/assets/lst36.png differ diff --git a/assets/lst37.png b/assets/lst37.png new file mode 100644 index 0000000..99ffe82 Binary files /dev/null and b/assets/lst37.png differ diff --git a/assets/lst38.png b/assets/lst38.png new file mode 100644 index 0000000..44b75b1 Binary files /dev/null and b/assets/lst38.png differ diff --git a/document.yaml b/document.yaml index c49334c..00a8dbd 100644 --- a/document.yaml +++ b/document.yaml @@ -1,23 +1,23 @@ doc_class: nitreport -title: Insert Title Here +title: 第6回課題 author: - name: 高専 太郎 - student_id: 0000-01 - seating_number: 1 + name: 柴田 健琉 + student_id: 2024D14 + seating_number: 15 date: year: 令和7年 - month: aa月 - day: bb日 + month: 05月 + day: 10日 turnin: year: 令和7年 - month: cc月 - day: dd日 + month: 05月 + day: 11日 -school_name: abc高専 -department: 一般科 -subject: 〇〇概論 -professor: □□教員 +school_name: 岐阜工業高等専門学校 +department: 電子制御工学科 +subject: 情報処理I +professor: 岡崎 憲一 paper_config: include_cover_page: true @@ -31,6 +31,13 @@ paper_config: # - { name: "pkg-wo-opt", options: "" } sections: - - { path: 'section/introduction.tex', newpg: true } - - { path: 'md-out/test.tex', newpg: false } + - { path: 'section/introduction.tex', newpg: false } + - { path: 'section/syntax.tex', newpg: true } + - { path: 'section/lst33.tex', newpg: true } + - { path: 'section/lst34.tex', newpg: true } + - { path: 'section/lst35.tex', newpg: true } + - { path: 'section/lst36.tex', newpg: true } + - { path: 'section/lst37.tex', newpg: true } + - { path: 'section/lst38.tex', newpg: true } + - { path: 'section/abs.tex', newpg: false } diff --git a/main.tex b/main.tex new file mode 100644 index 0000000..8eaaaac --- /dev/null +++ b/main.tex @@ -0,0 +1,49 @@ +\documentclass{class/nitreport} + +\reporttitle{第6回課題} +\reportauthor{柴田 健琉} +\studentid{2024D14} +\seatingnum{15} +\reportdate{令和7年}{05月}{10日} +\turnindate{令和7年}{05月}{11日} +\schoolname{岐阜工業高等専門学校} +\department{電子制御工学科} +\subject{情報処理I} +\professor{岡崎 憲一} + +\pagenumbering{roman} + +\begin{document} + \coverpage + + \tableofcontents + \newpage + \pagenumbering{arabic} + + \input{section/introduction.tex} + + \input{section/syntax.tex} + \newpage + + \input{section/lst33.tex} + \newpage + + \input{section/lst34.tex} + \newpage + + \input{section/lst35.tex} + \newpage + + \input{section/lst36.tex} + \newpage + + \input{section/lst37.tex} + \newpage + + \input{section/lst38.tex} + \newpage + + \input{section/abs.tex} + + \compiledTime +\end{document} diff --git a/output/main-opt-final.pdf b/output/main-opt-final.pdf new file mode 100644 index 0000000..47550ec Binary files /dev/null and b/output/main-opt-final.pdf differ diff --git a/output/main.pdf b/output/main.pdf new file mode 100644 index 0000000..5c84fb0 Binary files /dev/null and b/output/main.pdf differ diff --git a/programs/abs/info.json b/programs/abs/info.json new file mode 100644 index 0000000..62f51f8 --- /dev/null +++ b/programs/abs/info.json @@ -0,0 +1,10 @@ +{ + "language": "C", + "name": "演習課題 2", + "description": "整数値を読み込み、その絶対値を出力するプログラム。", + "output": { + "type": "screenshot", + "content": "./assets/abs.png" + }, + "note": "" +} diff --git a/programs/abs/main b/programs/abs/main new file mode 100755 index 0000000..481aa65 Binary files /dev/null and b/programs/abs/main differ diff --git a/programs/abs/main.c b/programs/abs/main.c new file mode 100644 index 0000000..7b9b10c --- /dev/null +++ b/programs/abs/main.c @@ -0,0 +1,17 @@ +#include + +int main(void) { + int x, y; + + printf("Input integer: "); + scanf("%d", &x); + + y = x; + + if (y < 0) + y = -y; + + printf("Absolute value of %d is %d.\n", x, y); + + return 0; +} diff --git a/programs/lst33/info.json b/programs/lst33/info.json new file mode 100644 index 0000000..1ad0e1f --- /dev/null +++ b/programs/lst33/info.json @@ -0,0 +1,10 @@ +{ + "language": "C", + "name": "演習課題 1 List 3-3", + "description": "5の倍数判定プログラム", + "output": { + "type": "screenshot", + "content": "./assets/lst33.png" + }, + "note": "" +} diff --git a/programs/lst33/main b/programs/lst33/main new file mode 100755 index 0000000..39c7066 Binary files /dev/null and b/programs/lst33/main differ diff --git a/programs/lst33/main.c b/programs/lst33/main.c new file mode 100644 index 0000000..d69b8d2 --- /dev/null +++ b/programs/lst33/main.c @@ -0,0 +1,15 @@ +#include + +int main(void) { + int n; + + printf("Input integer: "); + scanf("%d", &n); + + if (n % 5) + puts("The number is not divisible by 5."); + else + puts("The number is divisible by 5."); + + return 0; +} diff --git a/programs/lst34/info.json b/programs/lst34/info.json new file mode 100644 index 0000000..737922e --- /dev/null +++ b/programs/lst34/info.json @@ -0,0 +1,10 @@ +{ + "language": "C", + "name": "演習課題 1 List 3-4", + "description": "偶数奇数判定プログラム", + "output": { + "type": "screenshot", + "content": "./assets/lst34.png" + }, + "note": "" +} diff --git a/programs/lst34/main b/programs/lst34/main new file mode 100755 index 0000000..4b00293 Binary files /dev/null and b/programs/lst34/main differ diff --git a/programs/lst34/main.c b/programs/lst34/main.c new file mode 100644 index 0000000..6eefbd6 --- /dev/null +++ b/programs/lst34/main.c @@ -0,0 +1,15 @@ +#include + +int main(void) { + int n; + + printf("Input integer: "); + scanf("%d", &n); + + if (n % 2) + puts("The integer is odd."); + else + puts("The integer is even."); + + return 0; +} diff --git a/programs/lst35/info.json b/programs/lst35/info.json new file mode 100644 index 0000000..c5b1726 --- /dev/null +++ b/programs/lst35/info.json @@ -0,0 +1,10 @@ +{ + "language": "C", + "name": "演習課題 1 List 3-5", + "description": "非ヌル判定プログラム", + "output": { + "type": "screenshot", + "content": "./assets/lst35.png" + }, + "note": "" +} diff --git a/programs/lst35/main b/programs/lst35/main new file mode 100755 index 0000000..e7bbf06 Binary files /dev/null and b/programs/lst35/main differ diff --git a/programs/lst35/main.c b/programs/lst35/main.c new file mode 100644 index 0000000..7f5b1b0 --- /dev/null +++ b/programs/lst35/main.c @@ -0,0 +1,15 @@ +#include + +int main(void) { + int n; + + printf("Input integer: "); + scanf("%d", &n); + + if (n) + puts("The integer is not null(zero)."); + else + puts("The integer is null(zero)."); + + return 0; +} diff --git a/programs/lst36/info.json b/programs/lst36/info.json new file mode 100644 index 0000000..5b86ffd --- /dev/null +++ b/programs/lst36/info.json @@ -0,0 +1,10 @@ +{ + "language": "C", + "name": "演習課題 1 List 3-6", + "description": "2つの整数値の等価検証プログラム", + "output": { + "type": "screenshot", + "content": "./assets/lst36.png" + }, + "note": "" +} diff --git a/programs/lst36/main b/programs/lst36/main new file mode 100755 index 0000000..4e2efe1 Binary files /dev/null and b/programs/lst36/main differ diff --git a/programs/lst36/main.c b/programs/lst36/main.c new file mode 100644 index 0000000..ee554dc --- /dev/null +++ b/programs/lst36/main.c @@ -0,0 +1,18 @@ +#include + +int main(void) { + int n1, n2; + + printf("Integer 1: "); + scanf("%d", &n1); + + printf("Integer 2: "); + scanf("%d", &n2); + + if (n1 == n2) + puts("Both values are equivalent to each other."); + else + puts("Both values are not equivalent to each other."); + + return 0; +} diff --git a/programs/lst37/info.json b/programs/lst37/info.json new file mode 100644 index 0000000..3f11da8 --- /dev/null +++ b/programs/lst37/info.json @@ -0,0 +1,10 @@ +{ + "language": "C", + "name": "演習課題 1 List 3-7", + "description": "2つの整数値の等価検証プログラム\\n\\n\\\\ref{lst36}の条件の否定に変更したプログラム", + "output": { + "type": "screenshot", + "content": "./assets/lst37.png" + }, + "note": "" +} diff --git a/programs/lst37/main b/programs/lst37/main new file mode 100755 index 0000000..37cd492 Binary files /dev/null and b/programs/lst37/main differ diff --git a/programs/lst37/main.c b/programs/lst37/main.c new file mode 100644 index 0000000..5b41842 --- /dev/null +++ b/programs/lst37/main.c @@ -0,0 +1,18 @@ +#include + +int main(void) { + int n1, n2; + + printf("Integer 1: "); + scanf("%d", &n1); + + printf("Integer 2: "); + scanf("%d", &n2); + + if (n1 != n2) + puts("Both values are not equivalent to each other."); + else + puts("Both values are equivalent to each other."); + + return 0; +} diff --git a/programs/lst38/info.json b/programs/lst38/info.json new file mode 100644 index 0000000..dfbe42f --- /dev/null +++ b/programs/lst38/info.json @@ -0,0 +1,10 @@ +{ + "language": "C", + "name": "演習課題 1 List 3-8", + "description": "整数値の最下位桁判定プログラム", + "output": { + "type": "screenshot", + "content": "./assets/lst38.png" + }, + "note": "" +} diff --git a/programs/lst38/main b/programs/lst38/main new file mode 100755 index 0000000..71b6367 Binary files /dev/null and b/programs/lst38/main differ diff --git a/programs/lst38/main.c b/programs/lst38/main.c new file mode 100644 index 0000000..4bc538f --- /dev/null +++ b/programs/lst38/main.c @@ -0,0 +1,15 @@ +#include + +int main(void) { + int n; + + printf("Input integer: "); + scanf("%d", &n); + + if (n % 10 == 5) + puts("Ones digit of the integer is 5."); + else + puts("Ones digit of the integer is not 5."); + + return 0; +} diff --git a/section/abs.tex b/section/abs.tex new file mode 100644 index 0000000..951a3bd --- /dev/null +++ b/section/abs.tex @@ -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} diff --git a/section/introduction.tex b/section/introduction.tex index 3386076..ff9cc1c 100644 --- a/section/introduction.tex +++ b/section/introduction.tex @@ -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 - -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 .tex - \item biber - \item lualatex .tex - \item lualatex .tex -\end{enumerate} - -\newpage - -\section{Section} - -section - -\subsection{Sub Section} - -sub section - -\paragraph{Paragraph} - -paragraph diff --git a/section/lst33.tex b/section/lst33.tex new file mode 100644 index 0000000..9bc4624 --- /dev/null +++ b/section/lst33.tex @@ -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} diff --git a/section/lst34.tex b/section/lst34.tex new file mode 100644 index 0000000..6e23657 --- /dev/null +++ b/section/lst34.tex @@ -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} diff --git a/section/lst35.tex b/section/lst35.tex new file mode 100644 index 0000000..cd18c11 --- /dev/null +++ b/section/lst35.tex @@ -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} diff --git a/section/lst36.tex b/section/lst36.tex new file mode 100644 index 0000000..40c8f90 --- /dev/null +++ b/section/lst36.tex @@ -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} diff --git a/section/lst37.tex b/section/lst37.tex new file mode 100644 index 0000000..66febd1 --- /dev/null +++ b/section/lst37.tex @@ -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} diff --git a/section/lst38.tex b/section/lst38.tex new file mode 100644 index 0000000..e2779a6 --- /dev/null +++ b/section/lst38.tex @@ -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} diff --git a/section/syntax.tex b/section/syntax.tex new file mode 100644 index 0000000..a79f349 --- /dev/null +++ b/section/syntax.tex @@ -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} +