Compare commits
3 Commits
5beaf8abf0
...
52ecc1382f
| Author | SHA1 | Date | |
|---|---|---|---|
| 52ecc1382f | |||
| 3ede55482f | |||
| ff77070655 |
2
Makefile
2
Makefile
@@ -12,7 +12,7 @@ BIBFLAGS := --input-directory=$(OUTDIR) --output-directory=$(OUTDIR)/
|
|||||||
|
|
||||||
PRINTFORMAT := "\033[1;92;49m%s\033[m\n"
|
PRINTFORMAT := "\033[1;92;49m%s\033[m\n"
|
||||||
|
|
||||||
USE_MARKDOWN := true
|
USE_MARKDOWN := false
|
||||||
MARKDOWNS := $(wildcard markdown/*.md)
|
MARKDOWNS := $(wildcard markdown/*.md)
|
||||||
MARKDOWN_OUTPUTS := $(patsubst markdown/%.md,md-out/%.tex,$(MARKDOWNS))
|
MARKDOWN_OUTPUTS := $(patsubst markdown/%.md,md-out/%.tex,$(MARKDOWNS))
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
# CHANGEME
|
# information-processing-1_9th-class
|
||||||
|
|
||||||
|
Assignment for 9th class of Information Processing I.
|
||||||
|
|||||||
BIN
assets/p310.png
Normal file
BIN
assets/p310.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 157 KiB |
BIN
assets/p311.png
Normal file
BIN
assets/p311.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 118 KiB |
@@ -1,23 +1,23 @@
|
|||||||
doc_class: nitreport
|
doc_class: nitreport
|
||||||
|
|
||||||
title: Insert Title Here
|
title: 第9回課題
|
||||||
author:
|
author:
|
||||||
name: 高専 太郎
|
name: 柴田 健琉
|
||||||
student_id: 0000-01
|
student_id: 2024D14
|
||||||
seating_number: 1
|
seating_number: 15
|
||||||
date:
|
date:
|
||||||
year: 令和7年
|
year: 令和7年
|
||||||
month: aa月
|
month: 05月
|
||||||
day: bb日
|
day: 21日
|
||||||
turnin:
|
turnin:
|
||||||
year: 令和7年
|
year: 令和7年
|
||||||
month: cc月
|
month: 06月
|
||||||
day: dd日
|
day: 23日
|
||||||
|
|
||||||
school_name: abc高専
|
school_name: 岐阜工業高等専門学校
|
||||||
department: 一般科
|
department: 電子制御工学科
|
||||||
subject: 〇〇概論
|
subject: 情報処理I
|
||||||
professor: □□教員
|
professor: 岡崎 憲一
|
||||||
|
|
||||||
paper_config:
|
paper_config:
|
||||||
include_cover_page: true
|
include_cover_page: true
|
||||||
@@ -32,5 +32,6 @@ paper_config:
|
|||||||
|
|
||||||
sections:
|
sections:
|
||||||
- { path: 'section/introduction.tex', newpg: true }
|
- { path: 'section/introduction.tex', newpg: true }
|
||||||
- { path: 'md-out/test.tex', newpg: false }
|
- { path: 'section/p310.tex', newpg: true }
|
||||||
|
- { path: 'section/p311.tex', newpg: true }
|
||||||
|
|
||||||
|
|||||||
33
main.tex
Normal file
33
main.tex
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
\documentclass{class/nitreport}
|
||||||
|
|
||||||
|
\reporttitle{第9回課題}
|
||||||
|
\reportauthor{柴田 健琉}
|
||||||
|
\studentid{2024D14}
|
||||||
|
\seatingnum{15}
|
||||||
|
\reportdate{令和7年}{05月}{21日}
|
||||||
|
\turnindate{令和7年}{06月}{23日}
|
||||||
|
\schoolname{岐阜工業高等専門学校}
|
||||||
|
\department{電子制御工学科}
|
||||||
|
\subject{情報処理I}
|
||||||
|
\professor{岡崎 憲一}
|
||||||
|
|
||||||
|
\pagenumbering{roman}
|
||||||
|
|
||||||
|
\begin{document}
|
||||||
|
\coverpage
|
||||||
|
|
||||||
|
\tableofcontents
|
||||||
|
\newpage
|
||||||
|
\pagenumbering{arabic}
|
||||||
|
|
||||||
|
\input{section/introduction.tex}
|
||||||
|
\newpage
|
||||||
|
|
||||||
|
\input{section/p310.tex}
|
||||||
|
\newpage
|
||||||
|
|
||||||
|
\input{section/p311.tex}
|
||||||
|
\newpage
|
||||||
|
|
||||||
|
\compiledTime
|
||||||
|
\end{document}
|
||||||
@@ -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
BIN
output/main.pdf
Normal file
Binary file not shown.
10
programs/p310/info.json
Normal file
10
programs/p310/info.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"language": "C",
|
||||||
|
"name": "演習 3-10",
|
||||||
|
"description": "3つの整数値の等価検証プログラム。",
|
||||||
|
"output": {
|
||||||
|
"type": "screenshot",
|
||||||
|
"content": "./assets/p310.png"
|
||||||
|
},
|
||||||
|
"note": ""
|
||||||
|
}
|
||||||
BIN
programs/p310/main
Executable file
BIN
programs/p310/main
Executable file
Binary file not shown.
69
programs/p310/main.c
Normal file
69
programs/p310/main.c
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#ifndef USE_ALT
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
int a, b, c;
|
||||||
|
|
||||||
|
printf("Int A: ");
|
||||||
|
scanf("%d", &a);
|
||||||
|
printf("Int B: ");
|
||||||
|
scanf("%d", &b);
|
||||||
|
printf("Int C: ");
|
||||||
|
scanf("%d", &c);
|
||||||
|
|
||||||
|
if (a == b && a == c) {
|
||||||
|
printf("All three values are equal.\n");
|
||||||
|
} else if (a != b && a == c) {
|
||||||
|
printf("Two values are equal.\n");
|
||||||
|
} else if (a != c && a == b) {
|
||||||
|
printf("Two values are equal.\n");
|
||||||
|
} else if (b == c) {
|
||||||
|
printf("Two values are equal.\n");
|
||||||
|
} else {
|
||||||
|
printf("All three values are different.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // !(defined(USE_ALT))
|
||||||
|
|
||||||
|
#ifdef USE_ALT
|
||||||
|
|
||||||
|
#define NON_EQUAL 0
|
||||||
|
#define ONE_EQUAL 1
|
||||||
|
#define ALL_EQUAL 2
|
||||||
|
|
||||||
|
// alternetive answer
|
||||||
|
int main(void) {
|
||||||
|
int flag = 0; // remember, boolean in C is just integer
|
||||||
|
|
||||||
|
int a, b, c;
|
||||||
|
|
||||||
|
printf("Int A: ");
|
||||||
|
scanf("%d", &a);
|
||||||
|
printf("Int B: ");
|
||||||
|
scanf("%d", &b);
|
||||||
|
printf("Int C: ");
|
||||||
|
scanf("%d", &c);
|
||||||
|
|
||||||
|
flag += a == b;
|
||||||
|
flag += a == c;
|
||||||
|
|
||||||
|
if (flag != ALL_EQUAL) {
|
||||||
|
flag += b == c;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag == NON_EQUAL) {
|
||||||
|
printf("All three values are different.\n");
|
||||||
|
} else if (flag == ONE_EQUAL) {
|
||||||
|
printf("Two values are equal.\n");
|
||||||
|
} else {
|
||||||
|
printf("All three values are equal.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // defined(USE_ALT)
|
||||||
10
programs/p311/info.json
Normal file
10
programs/p311/info.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"language": "C",
|
||||||
|
"name": "演習 3-11",
|
||||||
|
"description": "論理OR演算子を使用して2つの整数値の差が10以下であるか、11以上であるかを検証するプログラム。",
|
||||||
|
"output": {
|
||||||
|
"type": "screenshot",
|
||||||
|
"content": "./assets/p311.png"
|
||||||
|
},
|
||||||
|
"note": ""
|
||||||
|
}
|
||||||
BIN
programs/p311/main
Executable file
BIN
programs/p311/main
Executable file
Binary file not shown.
20
programs/p311/main.c
Normal file
20
programs/p311/main.c
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
int a, b;
|
||||||
|
|
||||||
|
printf("Int A: ");
|
||||||
|
scanf("%d", &a);
|
||||||
|
printf("Int B: ");
|
||||||
|
scanf("%d", &b);
|
||||||
|
|
||||||
|
int diff = a - b;
|
||||||
|
|
||||||
|
if (diff >= 11 || diff <= -11) {
|
||||||
|
printf("Difference is greater than or equal to 11.\n");
|
||||||
|
} else {
|
||||||
|
printf("Difference is less than or equal to 10.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -1,70 +1,12 @@
|
|||||||
\section{はじめに}
|
\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}
|
\begin{itemize}
|
||||||
\item C
|
\item OS: NixOS 25.05 (Warbler)
|
||||||
\item Python
|
\item CPU アーキテクチャ: \texttt{x86\_64}
|
||||||
\item Javascript
|
\item C コンパイラ: \texttt{gcc バージョン 14.2.1 20250322 (GCC)}
|
||||||
\item Rust
|
\item C コンパイラオプション: \texttt{-Wall <ソースコード名> -o <実行ファイル名>}
|
||||||
\item Haskell
|
|
||||||
\end{itemize}
|
\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
|
|
||||||
|
|||||||
18
section/p310.tex
Normal file
18
section/p310.tex
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
\section{演習 3-10}
|
||||||
|
|
||||||
|
\vspace{-0.25cm}
|
||||||
|
|
||||||
|
3つの整数値の等価検証プログラム。
|
||||||
|
|
||||||
|
\subsection{コードリスティング}
|
||||||
|
|
||||||
|
\vspace{-0.75cm}
|
||||||
|
|
||||||
|
\defaultlistingstyle
|
||||||
|
\lstinputlisting[language=C,title={演習 3-10}]{../programs/p310/main.c}
|
||||||
|
|
||||||
|
\subsection{実行結果}
|
||||||
|
|
||||||
|
\begin{center}
|
||||||
|
\includegraphics[width=\textwidth]{./assets/p310.png}
|
||||||
|
\end{center}
|
||||||
14
section/p311.tex
Normal file
14
section/p311.tex
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
\section{演習 3-11}
|
||||||
|
|
||||||
|
論理OR演算子を使用して2つの整数値の差が10以下であるか、11以上であるかを検証するプログラム。
|
||||||
|
|
||||||
|
\subsection{コードリスティング}
|
||||||
|
|
||||||
|
\defaultlistingstyle
|
||||||
|
\lstinputlisting[language=C,title={演習 3-11}]{../programs/p311/main.c}
|
||||||
|
|
||||||
|
\subsection{実行結果}
|
||||||
|
|
||||||
|
\begin{center}
|
||||||
|
\includegraphics[width=\textwidth]{./assets/p311.png}
|
||||||
|
\end{center}
|
||||||
Reference in New Issue
Block a user