Finished first group of assignments
This commit is contained in:
@@ -1,67 +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!}
|
||||
|
||||
\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 <ソースコード名> -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
|
||||
|
||||
14
section/lst22.tex
Normal file
14
section/lst22.tex
Normal file
@@ -0,0 +1,14 @@
|
||||
\section{List 2ー2 +$\alpha$}
|
||||
|
||||
2桁以上の正の整数の十の位の数字を表示するプログラム。
|
||||
|
||||
\subsection{コードリスティング}
|
||||
|
||||
\defaultlistingstyle
|
||||
\lstinputlisting[language=C,title={List 2ー2 +$\alpha$}]{../programs/lst22/main.c}
|
||||
|
||||
\subsection{実行結果}
|
||||
|
||||
\begin{center}
|
||||
\includegraphics[width=\textwidth]{./assets/lst22.png}
|
||||
\end{center}
|
||||
14
section/prog1.tex
Normal file
14
section/prog1.tex
Normal file
@@ -0,0 +1,14 @@
|
||||
\section{演習 2ー1}
|
||||
|
||||
2つの整数値を読み込み、前者の値が後者の何\%であるかを表示するプログラム。
|
||||
|
||||
\subsection{コードリスティング}
|
||||
|
||||
\defaultlistingstyle
|
||||
\lstinputlisting[language=C,title={演習 2ー1}]{../programs/prog1/main.c}
|
||||
|
||||
\subsection{実行結果}
|
||||
|
||||
\begin{center}
|
||||
\includegraphics[width=\textwidth]{./assets/prog1.png}
|
||||
\end{center}
|
||||
14
section/prog2.tex
Normal file
14
section/prog2.tex
Normal file
@@ -0,0 +1,14 @@
|
||||
\section{演習 2ー2}
|
||||
|
||||
2つの整数値を読み込み、それらの和と積を表示するプログラム。
|
||||
|
||||
\subsection{コードリスティング}
|
||||
|
||||
\defaultlistingstyle
|
||||
\lstinputlisting[language=C,title={演習 2ー2}]{../programs/prog2/main.c}
|
||||
|
||||
\subsection{実行結果}
|
||||
|
||||
\begin{center}
|
||||
\includegraphics[width=\textwidth]{./assets/prog2.png}
|
||||
\end{center}
|
||||
16
section/rev3dig.tex
Normal file
16
section/rev3dig.tex
Normal file
@@ -0,0 +1,16 @@
|
||||
\section{課題4}
|
||||
|
||||
入力した三桁の正の整数の数字の並びを逆順させた数字を表示するプログラム。
|
||||
|
||||
\subsection{コードリスティング}
|
||||
|
||||
\vspace{-0.5cm}
|
||||
|
||||
\defaultlistingstyle
|
||||
\lstinputlisting[language=C,title={課題4}]{../programs/rev3dig/main.c}
|
||||
|
||||
\subsection{実行結果}
|
||||
|
||||
\begin{center}
|
||||
\includegraphics[width=12cm]{./assets/rev3dig.png}
|
||||
\end{center}
|
||||
0
section/syntax.tex
Normal file
0
section/syntax.tex
Normal file
Reference in New Issue
Block a user