started assignment and added programs

This commit is contained in:
2025-05-08 00:28:02 +09:00
parent 3ff7ace93a
commit 8912215a06
14 changed files with 130 additions and 102 deletions

13
section/comp.tex Normal file
View File

@@ -0,0 +1,13 @@
\section{演習課題2}
電卓とC言語での演算の違いを比較する。
\subsection{コードリスティング}
\lstinputlisting[language=C,title={演習課題2}]{../programs/comp/main.c}
\subsection{実行結果}
\begin{center}
\includegraphics[width=\textwidth]{./assets/comp.png}
\end{center}

View File

@@ -1,70 +1 @@
\section{はじめに}
Start Writing!
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
\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/p25.tex Normal file
View File

@@ -0,0 +1,13 @@
\section{演習課題1 演習2ー5}
2つの整数値を読み込み、前者の値が後者の値の何%であるかを倍精度浮動小数点数として表示するプログラム。
\subsection{コードリスティング}
\lstinputlisting[language=C,title={演習課題1 演習2ー5}]{../programs/p25/main.c}
\subsection{実行結果}
\begin{center}
\includegraphics[width=\textwidth]{./assets/p25.png}
\end{center}

13
section/p26.tex Normal file
View File

@@ -0,0 +1,13 @@
\section{演習課題1 演習2ー6}
身長を整数値として読み込み、標準体重を実数小数点以下1桁として表示するプログラム。なお標準体重は$0.9(height - 100)$で求めるものとする。
\subsection{コードリスティング}
\lstinputlisting[language=C,title={演習課題1 演習2ー6}]{../programs/p26/main.c}
\subsection{実行結果}
\begin{center}
\includegraphics[width=\textwidth]{./assets/p26.png}
\end{center}

0
section/syntax.tex Normal file
View File