This commit is contained in:
2025-07-03 12:05:57 +09:00
parent e10edbe753
commit fea9a38b1d
27 changed files with 255 additions and 98 deletions

View File

@@ -12,7 +12,7 @@ BIBFLAGS := --input-directory=$(OUTDIR) --output-directory=$(OUTDIR)/
PRINTFORMAT := "\033[1;92;49m%s\033[m\n"
USE_MARKDOWN := true
USE_MARKDOWN := false
MARKDOWNS := $(wildcard markdown/*.md)
MARKDOWN_OUTPUTS := $(patsubst markdown/%.md,md-out/%.tex,$(MARKDOWNS))

BIN
assets/p41.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
assets/p42.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

BIN
assets/p43.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
assets/p44.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

View File

@@ -1,28 +1,28 @@
doc_class: nitreport
title: Insert Title Here
title: 第12回課題
author:
name: 高専 太郎
student_id: 0000-01
seating_number: 1
name: 柴田 健琉
student_id: 2024D14
seating_number: 15
date:
year: 令和7年
month: aa
day: bb
month: 07
day: 03
turnin:
year: 令和7年
month: cc
day: dd
month: 07
day: 03
school_name: abc高専
department: 一般
subject: 〇〇概論
professor: □□教員
school_name: 岐阜工業高等専門学校
department: 電子制御工学
subject: 情報処理I
professor: 岡崎 憲一
paper_config:
include_cover_page: true
include_table_of_contents: true
use_bib: false
use_bib: true
use_additional_packages: false
show_compiled_time: true
@@ -31,6 +31,10 @@ 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/p41.tex', newpg: true }
- { path: 'section/p42.tex', newpg: true }
- { path: 'section/p43.tex', newpg: true }
- { path: 'section/p44.tex', newpg: true }

43
main.tex Normal file
View File

@@ -0,0 +1,43 @@
\documentclass{class/nitreport}
\reporttitle{第12回課題}
\reportauthor{柴田 健琉}
\studentid{2024D14}
\seatingnum{15}
\reportdate{令和7年}{07月}{03日}
\turnindate{令和7年}{07月}{03日}
\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/p41.tex}
\newpage
\input{section/p42.tex}
\newpage
\input{section/p43.tex}
\newpage
\input{section/p44.tex}
\newpage
\printbibliography[heading=bibintoc,title={参考文献}]
\compiledTime
\end{document}

View File

@@ -1,18 +0,0 @@
# Hi
| x | y |
| --- | --- |
| 0 | 0 |
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 | 4 |
* i1
* i2
* i3
1. n1
2. n2
3. n3

BIN
output/main.pdf Normal file

Binary file not shown.

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

@@ -0,0 +1,10 @@
{
"language": "C",
"name": "課題1",
"description": "教科書の演習4ー1の解答",
"output": {
"type": "screenshot",
"content": "./assets/p41.png"
},
"note": ""
}

BIN
programs/p41/main Executable file

Binary file not shown.

24
programs/p41/main.c Normal file
View File

@@ -0,0 +1,24 @@
#include <stdio.h>
int main(void) {
int n;
int retry = 1;
do {
printf("Input integer: ");
scanf("%d", &n);
if (n > 0) {
printf("%d is positive.\n", n);
} else if (n < 0) {
printf("%d is negative.\n", n);
} else {
printf("It is zero.\n");
}
printf("Retry? [1/0]: ");
scanf("%d", &retry);
} while (retry == 1);
return 0;
}

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

@@ -0,0 +1,10 @@
{
"language": "C",
"name": "課題2",
"description": "教科書の演習4ー2の解答",
"output": {
"type": "screenshot",
"content": "./assets/p42.png"
},
"note": ""
}

BIN
programs/p42/main Executable file

Binary file not shown.

21
programs/p42/main.c Normal file
View File

@@ -0,0 +1,21 @@
#include <stdio.h>
int main(void) {
int a, b, i, ans;
printf("Input upper limit: ");
(void)scanf("%d", &a);
printf("Input lower limit: ");
(void)scanf("%d", &b);
i = b;
ans = 0;
do {
ans += i++;
} while (i <= a);
printf("Sum of all integer between %d and %d is %d.\n", b, a, ans);
return 0;
}

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

@@ -0,0 +1,10 @@
{
"language": "C",
"name": "課題3",
"description": "教科書の演習4ー3の解答",
"output": {
"type": "screenshot",
"content": "./assets/p43.png"
},
"note": ""
}

BIN
programs/p43/main Executable file

Binary file not shown.

19
programs/p43/main.c Normal file
View File

@@ -0,0 +1,19 @@
#include <stdio.h>
int main(void) {
int n;
printf("Input positive integer: ");
scanf("%d", &n);
while (n >= 0) {
printf("%d ", n);
n--;
if (n < 0) {
printf("\n");
}
}
return 0;
}

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

@@ -0,0 +1,10 @@
{
"language": "C",
"name": "課題4",
"description": "教科書の演習4ー4の解答",
"output": {
"type": "screenshot",
"content": "./assets/p44.png"
},
"note": ""
}

BIN
programs/p44/main Executable file

Binary file not shown.

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

@@ -0,0 +1,18 @@
#include <stdio.h>
int main(void) {
int n;
printf("Input positive integer: ");
scanf("%d", &n);
while (n > 0) {
printf("%d ", n--);
if (n == 0) {
printf("\n");
}
}
return 0;
}

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: Arch Linux
\item CPU アーキテクチャ: \texttt{x86\_64}
\item C コンパイラ: \texttt{gcc バージョン 14.2.1 20250322 (GCC)}
\item C コンパイラオプション: \texttt{-Wall}
\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/p41.tex Normal file
View File

@@ -0,0 +1,13 @@
\section{課題1}
教科書の演習4ー1の解答
\subsection{コードリスティング}
\lstinputlisting[language=C,title={課題1}]{../programs/p41/main.c}
\subsection{実行結果}
\begin{center}
\includegraphics[width=\textwidth]{./assets/p41.png}
\end{center}

13
section/p42.tex Normal file
View File

@@ -0,0 +1,13 @@
\section{課題2}
教科書の演習4ー2の解答
\subsection{コードリスティング}
\lstinputlisting[language=C,title={課題2}]{../programs/p42/main.c}
\subsection{実行結果}
\begin{center}
\includegraphics[width=\textwidth]{./assets/p42.png}
\end{center}

13
section/p43.tex Normal file
View File

@@ -0,0 +1,13 @@
\section{課題3}
教科書の演習4ー3の解答
\subsection{コードリスティング}
\lstinputlisting[language=C,title={課題3}]{../programs/p43/main.c}
\subsection{実行結果}
\begin{center}
\includegraphics[width=\textwidth]{./assets/p43.png}
\end{center}

13
section/p44.tex Normal file
View File

@@ -0,0 +1,13 @@
\section{課題4}
教科書の演習4ー4の解答
\subsection{コードリスティング}
\lstinputlisting[language=C,title={課題4}]{../programs/p44/main.c}
\subsection{実行結果}
\begin{center}
\includegraphics[width=\textwidth]{./assets/p44.png}
\end{center}

12
section/syntax.tex Normal file
View File

@@ -0,0 +1,12 @@
\section{今回の構文}
\subsection{\texttt{while}}
繰り返しを記述する構文の一つで、こちらはループ内の処理を行う前に条件式を評価する。
\defaultlistingstyle
\begin{lstlisting}[language=C,title={\texttt{while}}]
while (<条件式>) {
文...;
}
\end{lstlisting}