FortranStop语句

JavaScript ww9992019com 发表于 5 天前

<div style="width:100%;float:left;" class="article-content">

                <input type="hidden" name="article_id" id="article_id" value="5886">
                <input type="hidden" name="catid" id="catid" value="0">

                <p>

如果想执行的程序停止,可以插入一个stop语句。</p>

<p>

示例</p>

<pre class="prettyprint notranslate tryit prettyprinted" courier new monospace border-top-left-radius: border-top-right-radius: border-bottom-right-radius: border-bottom-left-radius: width: line-height: font-size: overflow: auto color: rgb cursor: default background-image: url background-attachment: initial background-size: background-origin: background-clip: background-position: background-repeat: no-repeat>

<span class="pln">program stop_example

</span><span class="kwd">implicit</span><span class="pln"> none

integer </span><span class="pun">::</span><span class="pln"> i

</span><span class="kwd">do</span><span class="pln"> i </span><span class="pun">=</span><span class="pln"> </span><span class="lit">1</span><span class="pun">,</span><span class="pln"> </span><span class="lit">20</span><span class="pln">

  </span><span class="kwd">if</span><span class="pln"> </span><span class="pun">(</span><span class="pln">i </span><span class="pun">==</span><span class="pln"> </span><span class="lit">5</span><span class="pun">)</span><span class="pln"> </span><span class="kwd">then</span><span class="pln">

     stop

  </span><span class="kwd">end</span><span class="pln"> </span><span class="kwd">if</span><span class="pln">



  </span><span class="kwd">print</span><span class="pun">*,</span><span class="pln"> i

</span><span class="kwd">end</span><span class="pln"> </span><span class="kwd">do</span><span class="pln">

</span><span class="kwd">end</span><span class="pln"> program stop_example</span></pre>

<p>

当上述代码被编译和执行时,它产生了以下结果:</p>

<pre class="result notranslate" courier new monospace margin-bottom: border-top-left-radius: border-top-right-radius: border-bottom-right-radius: border-bottom-left-radius: width: font-size: overflow: auto color: rgb line-height: background-color:>

1

2

3

4</pre>

                <br>
                <p style="text-align:center;float:left;width:100%;margin-top:24px;margin-bottom:18px;">
                        <button class="layui-btn layui-btn-danger" id="btn-reward"> ¥ 我要打赏 </button>  
                        <button class="layui-btn" id="article-perfect">
                            <i class="layui-icon layui-icon-edit"></i>教程纠错
                        </button>
                        <button class="layui-btn layui-btn-normal" id="action-collection">
                            <i class="layui-icon layui-icon-rate"></i>收藏
                        </button>
                </p>



                <div style="width:100%;margin-bottom: 16px; height: 32px;margin-top:18px;float:left;">

                    <span style="float:left;">上一篇:<a href="http://f2e.im/u/ww9992019com" title="Fortran Cycle语句"><i class="layui-icon"></i>
                            Fortran Cycle语句</a></span>
                                            <span style="float:right;">下一篇:<a href="http://f2e.im/u/ww9992019com" style="float:right;" title="下一篇:Fortran数字"><i class="layui-icon"></i>
                            Fortran数字</a></span>
                                            <div id="googlead" style="float:left;margin-top:8px;">
                        <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
                        <!-- yiibai下方 -->
                        <ins class="adsbygoogle" style="display:inline-block;width:728px;height:90px" data-ad-client="ca-pub-1090193214637198" data-ad-slot="6494738921"></ins>
                        <script>
                            (adsbygoogle = window.adsbygoogle || []).push({});
                        </script>
                    </div>
                </div>

                <div style="width:100%;margin-top:18px;float:left;">


            </div>
暂无回复,说出你的观点吧
登录后即可参与回复