done
This commit is contained in:
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