0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

擬似言語プログラム

Posted at

image.png
1:繰り返し
 繰り返し処理には、while,do~while,for命令を使います。

①while命令
whileは、下記の形式で記述します。while直後の()の中にループ継続条件を指定します。whileは、条件が成立している間、処理1を繰り返し実行します。条件が不成立になるとendwhile直後の行から先を実行します。

「whileの記述形式」
while(ループ継続条件)
  処理1
endwhile

 whileは、全判定型ループといい、「処理を実行する前に条件を判定する」という動作が特徴です。
 条件式判定(成立) → 処理1 → 条件式判定(成立) → 処理1  → ‥ → 条件式判定(不成立) → 終了 (endwhileの次の日行へ移る)
と処理が進みます。ループを始めるにあたって、まず条件式の判定を行いますので、最初から条件式が不成立の場合には、「処理1」は一度も実行されません。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?