done
This commit is contained in:
@@ -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/p413.tex
Normal file
13
section/p413.tex
Normal file
@@ -0,0 +1,13 @@
|
||||
\section{演習 4-13}
|
||||
|
||||
1から$n$までの総和を求めるプログラム。
|
||||
|
||||
\subsection{コードリスティング}
|
||||
|
||||
\lstinputlisting[language=C,title={演習 4-13}]{../programs/p413/main.c}
|
||||
|
||||
\subsection{実行結果}
|
||||
|
||||
\begin{center}
|
||||
\includegraphics[width=\textwidth]{./assets/p413.png}
|
||||
\end{center}
|
||||
13
section/p414.tex
Normal file
13
section/p414.tex
Normal file
@@ -0,0 +1,13 @@
|
||||
\section{演習 4-14}
|
||||
|
||||
1,2,3...8,9,0を入力した整数値個表示するプログラム。
|
||||
|
||||
\subsection{コードリスティング}
|
||||
|
||||
\lstinputlisting[language=C,title={演習 4-14}]{../programs/p414/main.c}
|
||||
|
||||
\subsection{実行結果}
|
||||
|
||||
\begin{center}
|
||||
\includegraphics[width=\textwidth]{./assets/p414.png}
|
||||
\end{center}
|
||||
13
section/p418.tex
Normal file
13
section/p418.tex
Normal file
@@ -0,0 +1,13 @@
|
||||
\section{演習 4-18}
|
||||
|
||||
入力した整数値の個数分アスタリスクを各行に5個ずつ表示するプログラム。
|
||||
|
||||
\subsection{コードリスティング}
|
||||
|
||||
\lstinputlisting[language=C,title={演習 4-18}]{../programs/p418/main.c}
|
||||
|
||||
\subsection{実行結果}
|
||||
|
||||
\begin{center}
|
||||
\includegraphics[width=\textwidth]{./assets/p418.png}
|
||||
\end{center}
|
||||
13
section/p419.tex
Normal file
13
section/p419.tex
Normal file
@@ -0,0 +1,13 @@
|
||||
\section{演習 4-19}
|
||||
|
||||
入力した整数値の全約数とその個数を表示するプログラム。
|
||||
|
||||
\subsection{コードリスティング}
|
||||
|
||||
\lstinputlisting[language=C,title={演習 4-19}]{../programs/p419/main.c}
|
||||
|
||||
\subsection{実行結果}
|
||||
|
||||
\begin{center}
|
||||
\includegraphics[width=\textwidth]{./assets/p419.png}
|
||||
\end{center}
|
||||
23
section/syntax.tex
Normal file
23
section/syntax.tex
Normal file
@@ -0,0 +1,23 @@
|
||||
\section{今回の構文}
|
||||
|
||||
\section{\texttt{for}文}
|
||||
|
||||
\texttt{for}文は繰り返しを記述する方法の一つで、1つの文と2つ式で構成される。
|
||||
それぞれの式・文はセミコロンで分けられている。
|
||||
\cite{cppref}
|
||||
|
||||
\defaultlistingstyle
|
||||
\begin{lstlisting}[language=C, title={\texttt{for}文}]
|
||||
for (<カウンターの初期化文> ; <条件式> ; <反復式>) {
|
||||
<文>...;
|
||||
}
|
||||
\end{lstlisting}
|
||||
|
||||
初期化文、条件式、反復式を全て省略すると無限ループになる。
|
||||
|
||||
\begin{lstlisting}[language=C, title={\texttt{for}文による無限ループ}]
|
||||
for (;;) {
|
||||
<文>...;
|
||||
}
|
||||
\end{lstlisting}
|
||||
|
||||
Reference in New Issue
Block a user