130-if else语句

分支-if语句

if else语法
if(<test>)
<code executed if <test> is true>
else
<code executed if <test> is false>

如果if和else要执行的代码有多行,可以加上{}组成一个块

if(<test>){
<code executed if <test> is true>
}else{
<code executed if <test> is false>
}

  

posted @ 2018-11-16 15:33  阿晖2222  阅读(107)  评论(0编辑  收藏  举报