There was a left over.
This commit is contained in:
BIN
assets/abs-floating.png
Normal file
BIN
assets/abs-floating.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 74 KiB |
@@ -39,5 +39,6 @@ sections:
|
||||
- { path: 'section/lst36.tex', newpg: true }
|
||||
- { path: 'section/lst37.tex', newpg: true }
|
||||
- { path: 'section/lst38.tex', newpg: true }
|
||||
- { path: 'section/abs.tex', newpg: false }
|
||||
- { path: 'section/abs.tex', newpg: true }
|
||||
- { path: 'section/abs-floating.tex', newpg: false }
|
||||
|
||||
|
||||
3
main.tex
3
main.tex
@@ -44,6 +44,9 @@
|
||||
\newpage
|
||||
|
||||
\input{section/abs.tex}
|
||||
\newpage
|
||||
|
||||
\input{section/abs-floating.tex}
|
||||
|
||||
\compiledTime
|
||||
\end{document}
|
||||
|
||||
Binary file not shown.
BIN
output/main.pdf
BIN
output/main.pdf
Binary file not shown.
10
programs/abs-floating/info.json
Normal file
10
programs/abs-floating/info.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"language": "C",
|
||||
"name": "演習課題2 浮動小数点数版",
|
||||
"description": "倍精度浮動小数点数を読み込み、その絶対値を出力するプログラム。",
|
||||
"output": {
|
||||
"type": "screenshot",
|
||||
"content": "./assets/abs-floating.png"
|
||||
},
|
||||
"note": ""
|
||||
}
|
||||
BIN
programs/abs-floating/main
Executable file
BIN
programs/abs-floating/main
Executable file
Binary file not shown.
17
programs/abs-floating/main.c
Normal file
17
programs/abs-floating/main.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
double x, y;
|
||||
|
||||
printf("Input floating point: ");
|
||||
scanf("%lf", &x);
|
||||
|
||||
y = x;
|
||||
|
||||
if (y < 0.0)
|
||||
y = -y;
|
||||
|
||||
printf("Absolute value of %lf is %lf.\n", x, y);
|
||||
|
||||
return 0;
|
||||
}
|
||||
13
section/abs-floating.tex
Normal file
13
section/abs-floating.tex
Normal file
@@ -0,0 +1,13 @@
|
||||
\section{演習課題2 浮動小数点数版}
|
||||
|
||||
倍精度浮動小数点数を読み込み、その絶対値を出力するプログラム。
|
||||
|
||||
\subsection{コードリスティング}
|
||||
|
||||
\lstinputlisting[language=C,title={演習課題2 浮動小数点数版}]{../programs/abs-floating/main.c}
|
||||
|
||||
\subsection{実行結果}
|
||||
|
||||
\begin{center}
|
||||
\includegraphics[width=\textwidth]{./assets/abs-floating.png}
|
||||
\end{center}
|
||||
Reference in New Issue
Block a user