各繰り返し処理の書き方のソースを表示
←
各繰り返し処理の書き方
ナビゲーションに移動
検索に移動
あなたには「このページの編集」を行う権限がありません。理由は以下の通りです:
この操作は、以下のグループに属する利用者のみが実行できます:
登録利用者
。
このページのソースの閲覧やコピーができます。
<div class=WordSection1 style='layout-grid:18.0pt'> <p class=MsoNormal align=center style='text-align:center'><span style='font-size:24.0pt'>各言語比較<span lang=EN-US>~</span>繰り返し処理編<span lang=EN-US>~</span>の<span lang=EN-US>wiki</span></span></p> <p class=MsoNormal>各、繰り返し処理の書き方です。</p> <p class=MsoNormal align=center style='text-align:center'><b><span lang=EN-US style='font-size:22.0pt'>for</span><span style='font-size:22.0pt'>文</span></b></p> <p class=MsoNormal><span lang=EN-US style='font-size:14.0pt'>java</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#C586C0'>for</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>(</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#4EC9B0'>int</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'> </span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#9CDCFE'>x</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'> ; </span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#9CDCFE'>x</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'> < </span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#9CDCFE'>100</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>; </span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#9CDCFE'>x</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>++){</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'> </span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#6A9955'>//</span><span style='font-size:16.0pt;font-family:"MS Pゴシック";color:#6A9955'>繰り返し処理</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>}</span></p> <p class=MsoNormal><span lang=EN-US style='font-size:14.0pt'>C</span></p> <p class=MsoNormal align=center style='text-align:center'><b><span style='color:red'>準備中</span></b></p> <p class=MsoNormal><span lang=EN-US style='font-size:14.0pt'>Python3</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#C586C0'>for</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>(x </span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#569CD6'>in</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'> </span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#DCDCAA'>range</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>(</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#B5CEA8'>100</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>)):</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><u><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#FDABE6'> </span></u><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#6A9955'>#</span><span style='font-size:16.0pt;font-family:"MS Pゴシック";color:#6A9955'>繰り返し処理</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'> </span></p> <p class=MsoNormal align=left style='text-align:left'><b><span style='color:red'>準備中</span></b></p> <p class=MsoNormal align=center style='text-align:center'><b><span lang=EN-US style='font-size:22.0pt'>do</span><span style='font-size:22.0pt'>文</span></b></p> <p class=MsoNormal><span lang=EN-US style='font-size:14.0pt'>java</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#C586C0'>do</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>{</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'> </span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#6A9955'>//</span><span style='font-size:16.0pt;font-family:"MS Pゴシック";color:#6A9955'>繰り返し処理</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>}</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#C586C0'>while</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>(x < </span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#B5CEA8'>100</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>);</span></p> <p class=MsoNormal><span lang=EN-US style='font-size:14.0pt'>C</span></p> <p class=MsoNormal align=center style='text-align:center'><b><span style='color:red'>準備中</span></b></p> <p class=MsoNormal><span lang=EN-US style='font-size:14.0pt'>Python3</span></p> <p class=MsoNormal align=center style='text-align:center;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;color:yellow'>Python</span><span style='font-size:16.0pt;color:yellow'>には<span lang=EN-US>Do</span>文は<b><u>存在</u></b>しません。<span lang=EN-US>while</span>文を参照ください!</span></p> <p class=MsoNormal align=left style='text-align:left'><b><span style='color:red'>準備中</span></b></p> <p class=MsoNormal align=center style='text-align:center'><b><span lang=EN-US style='font-size:22.0pt'>1.whlie</span><span style='font-size:22.0pt'>文</span></b></p> <p class=MsoNormal align=left style='text-align:left'><span lang=EN-US style='font-size:14.0pt'>java</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#C586C0'>while</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>(</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#9CDCFE'>x</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'> < </span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#B5CEA8'>100</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>){</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'> </span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#6A9955'>//</span><span style='font-size:16.0pt;font-family:"MS Pゴシック";color:#6A9955'>繰り返し処理</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>}</span></p> <p class=MsoNormal align=left style='text-align:left'><span lang=EN-US style='font-size:14.0pt'>C</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#C586C0'>while</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>(x < </span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#B5CEA8'>100</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>){</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'> </span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#6A9955'>//</span><span style='font-size:16.0pt;font-family:"MS Pゴシック";color:#6A9955'>繰り返し処理</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>}</span></p> <p class=MsoNormal><span lang=EN-US style='font-size:14.0pt'>Python3</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#C586C0'>while</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'> (x < </span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#B5CEA8'>100</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>):</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><u><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#FDABE6'> </span></u><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#6A9955'>#</span><span style='font-size:16.0pt;font-family:"MS Pゴシック";color:#6A9955'>繰り返し処理</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'> </span></p> <p class=MsoNormal align=left style='text-align:left'><b><span style='color:red'>準備中</span></b></p> <p class=MsoNormal align=center style='text-align:center'><b><span lang=EN-US style='font-size:18.0pt'>2.Bool</span><span style='font-size:18.0pt'>型を使った版</span></b></p> <p class=MsoNormal><b><span lang=EN-US style='font-size:18.0pt'>Java</span></b></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#C586C0'>while</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>(</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#569CD6'>true</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>){</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'> </span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#6A9955'>//</span><span style='font-size:16.0pt;font-family:"MS Pゴシック";color:#6A9955'>繰り返し処理</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>}</span></p> <p class=MsoNormal><span lang=EN-US style='font-size:18.0pt'>C</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#C586C0'>while</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>(</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#B5CEA8'>1</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>){</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'> </span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#6A9955'>//</span><span style='font-size:16.0pt;font-family:"MS Pゴシック";color:#6A9955'>繰り返し処理</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>}</span></p> <p class=MsoNormal><span style='font-size:10.0pt'>※cには<span lang=EN-US>True</span>・<span lang=EN-US>false</span>の文字がない?</span></p> <p class=MsoNormal><b><span lang=EN-US style='font-size:18.0pt'>Python3</span></b></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#C586C0'>while</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'> </span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#569CD6'>True</span><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'>:</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><u><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#FDABE6'> </span></u><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#6A9955'>#</span><span style='font-size:16.0pt;font-family:"MS Pゴシック";color:#6A9955'>繰り返し処理</span></p> <p class=MsoNormal align=left style='text-align:left;background:#1E1E1E'><span lang=EN-US style='font-size:16.0pt;font-family:Consolas;color:#D4D4D4'> </span></p> <p class=MsoNormal><span lang=EN-US style='font-size:10.0pt'> </span></p> </div> [[カテゴリ:C言語]] [[カテゴリ:Java]] [[カテゴリ:Python]] [[カテゴリ:Program]]
各繰り返し処理の書き方
に戻る。
案内メニュー
個人用ツール
アカウント作成
ログイン
名前空間
ページ
議論
日本語
表示
閲覧
ソースを閲覧
履歴表示
その他
検索
案内
メインページ
最近の更新
おまかせ表示
MediaWikiについてのヘルプ
コード系
Program
PHP
Java
Python
Swift
JavaScript
HTML
CSS
C言語
MySQL
サーバー系
Apache2
OS系
Debian
kail
アプリケーション系
Xcode
Android Studio
計算系
ファイル系
速度系
メモ・業務
My命名規則
ツール
リンク元
関連ページの更新状況
特別ページ
ページ情報
編集
左メニュー
動画挿入について
動画・音声を追加する
JavaScriptを埋め込む
ページにリダイレクトを指定する