Negative days completion.

This commit is contained in:
2025-05-11 00:44:19 +09:00
parent 1158462054
commit f12d0bbc49
42 changed files with 377 additions and 79 deletions

View File

@@ -1,2 +1,3 @@
# CHANGEME
# information-processing-1_6th-class
Assignment for 6th class of Information Processing I.

BIN
assets/abs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

BIN
assets/lst33.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

BIN
assets/lst34.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

BIN
assets/lst35.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

BIN
assets/lst36.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

BIN
assets/lst37.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

BIN
assets/lst38.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

View File

@@ -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 }

49
main.tex Normal file
View File

@@ -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}

BIN
output/main-opt-final.pdf Normal file

Binary file not shown.

BIN
output/main.pdf Normal file

Binary file not shown.

10
programs/abs/info.json Normal file
View File

@@ -0,0 +1,10 @@
{
"language": "C",
"name": "演習課題 2",
"description": "整数値を読み込み、その絶対値を出力するプログラム。",
"output": {
"type": "screenshot",
"content": "./assets/abs.png"
},
"note": ""
}

BIN
programs/abs/main Executable file

Binary file not shown.

17
programs/abs/main.c Normal file
View File

@@ -0,0 +1,17 @@
#include <stdio.h>
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;
}

10
programs/lst33/info.json Normal file
View File

@@ -0,0 +1,10 @@
{
"language": "C",
"name": "演習課題 1 List 3-3",
"description": "5の倍数判定プログラム",
"output": {
"type": "screenshot",
"content": "./assets/lst33.png"
},
"note": ""
}

BIN
programs/lst33/main Executable file

Binary file not shown.

15
programs/lst33/main.c Normal file
View File

@@ -0,0 +1,15 @@
#include <stdio.h>
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;
}

10
programs/lst34/info.json Normal file
View File

@@ -0,0 +1,10 @@
{
"language": "C",
"name": "演習課題 1 List 3-4",
"description": "偶数奇数判定プログラム",
"output": {
"type": "screenshot",
"content": "./assets/lst34.png"
},
"note": ""
}

BIN
programs/lst34/main Executable file

Binary file not shown.

15
programs/lst34/main.c Normal file
View File

@@ -0,0 +1,15 @@
#include <stdio.h>
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;
}

10
programs/lst35/info.json Normal file
View File

@@ -0,0 +1,10 @@
{
"language": "C",
"name": "演習課題 1 List 3-5",
"description": "非ヌル判定プログラム",
"output": {
"type": "screenshot",
"content": "./assets/lst35.png"
},
"note": ""
}

BIN
programs/lst35/main Executable file

Binary file not shown.

15
programs/lst35/main.c Normal file
View File

@@ -0,0 +1,15 @@
#include <stdio.h>
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;
}

10
programs/lst36/info.json Normal file
View File

@@ -0,0 +1,10 @@
{
"language": "C",
"name": "演習課題 1 List 3-6",
"description": "2つの整数値の等価検証プログラム",
"output": {
"type": "screenshot",
"content": "./assets/lst36.png"
},
"note": ""
}

BIN
programs/lst36/main Executable file

Binary file not shown.

18
programs/lst36/main.c Normal file
View File

@@ -0,0 +1,18 @@
#include <stdio.h>
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;
}

10
programs/lst37/info.json Normal file
View File

@@ -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": ""
}

BIN
programs/lst37/main Executable file

Binary file not shown.

18
programs/lst37/main.c Normal file
View File

@@ -0,0 +1,18 @@
#include <stdio.h>
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;
}

10
programs/lst38/info.json Normal file
View File

@@ -0,0 +1,10 @@
{
"language": "C",
"name": "演習課題 1 List 3-8",
"description": "整数値の最下位桁判定プログラム",
"output": {
"type": "screenshot",
"content": "./assets/lst38.png"
},
"note": ""
}

BIN
programs/lst38/main Executable file

Binary file not shown.

15
programs/lst38/main.c Normal file
View File

@@ -0,0 +1,15 @@
#include <stdio.h>
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;
}

13
section/abs.tex Normal file
View 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}

View File

@@ -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
View 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
View 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
View 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
View 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
View 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
View 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
View 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}